From c07539106af7454380d9a43c4a08b61cf5ca9bc0 Mon Sep 17 00:00:00 2001 From: Nathan Rashleigh Date: Thu, 18 Sep 2025 21:17:27 +1000 Subject: [PATCH] macos --- .gitignore | 4 ++++ etc/maple_setup.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ etc/sldl.macos.yaml | 17 +++++++++++++++++ justfile | 10 +++++++++- 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100755 etc/maple_setup.sh create mode 100644 etc/sldl.macos.yaml diff --git a/.gitignore b/.gitignore index 9c16920..8b633e8 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +**/.DS_Store + *.sql *.sql.gz *.tar.gz @@ -16,3 +18,5 @@ surf.sublime-workspace **/target maple.sublime-workspace *.secret.yaml + +etc/sldl-macos.yaml \ No newline at end of file diff --git a/etc/maple_setup.sh b/etc/maple_setup.sh new file mode 100755 index 0000000..b42e3e5 --- /dev/null +++ b/etc/maple_setup.sh @@ -0,0 +1,42 @@ +#! /bin/bash + +set -ue + +maple="$HOME/maple" +data="$HOME/maple/data" +metadata="$data/_metadata" +etc="$maple/etc" +sldl_conf="$etc/sldl-macos.conf" + +directories() { + mkdir -p $data + mkdir -p $metadata + mkdir -p $etc +} + +configure() { + envsubst < $etc/sldl.tpl.conf > $sldl_conf + + echo "--------------------------------------------------------------" + echo "configured sldl" + cat $sldl_conf + echo "--------------------------------------------------------------" +} + +s5cmd_completion() { + s5cmd --install-completion >> $HOME/.bashrc +} + +ok() { + echo "ok" + env +} + +main() { + directories + configure + s5cmd_completion + ok +} + +main \ No newline at end of file diff --git a/etc/sldl.macos.yaml b/etc/sldl.macos.yaml new file mode 100644 index 0000000..8e3cd58 --- /dev/null +++ b/etc/sldl.macos.yaml @@ -0,0 +1,17 @@ +path = "~/maple/data" +index-path = "~/maple/data/_metadata/index.sldl.csv" +username = "ntwl" +password = "ninety nonsense nights" + +name-format = "{artist(/)album(/)track( )title|(_missing_tags/)slsk-foldername(/)slsk-filename}" +write-playlist = true + +pref-format = "mp3" +pref-min-bitrate = 200 +pref-max-bitrate = 2500 + +strict-conditions = true +fast-search = true +interactive = false +no-progress = true +concurrent-downloads = 4 diff --git a/justfile b/justfile index a9d6a5a..e369907 100644 --- a/justfile +++ b/justfile @@ -24,4 +24,12 @@ exec: dl trg: docker compose -f compose.yaml run \ --remove-orphans \ - maple -- sldl {{trg}} + +sync args: + s5cmd {{args}} + +maple-setup: + bash ./etc/maple_setup.sh + +maple trg: + sldl -c ./etc/sldl-macos.yaml {{trg}} \ No newline at end of file