From 1a9fc5d307509b3392152b5e5b004d86563dc303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Thu, 5 Sep 2024 15:04:28 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20style(bin):=20downloadSpotify=20?= =?UTF-8?q?tab=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/downloadSpotify | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.local/bin/downloadSpotify b/.local/bin/downloadSpotify index 446d0017..92be1b70 100755 --- a/.local/bin/downloadSpotify +++ b/.local/bin/downloadSpotify @@ -1,12 +1,12 @@ #!/bin/bash notify() { - notify-send "Spotdl Sync" "$1" --icon=spotify --app-name=Spotify + notify-send "Spotdl Sync" "$1" --icon=spotify --app-name=Spotify } if ! command -v spotdl &>/dev/null; then - notify "Error: spotdl is not installed" - exit 1 + notify "Error: spotdl is not installed" + exit 1 fi MUSIC_FOLDER="$HOME/music/listen-to" @@ -14,12 +14,12 @@ MUSIC_FOLDER="$HOME/music/listen-to" notify "Started syncing..." while IFS= read -r -d '' SPOTDL_FILE; do - if [[ -f "$SPOTDL_FILE" && "$SPOTDL_FILE" == *.spotdl ]]; then - FOLDER_NAME=$(basename "$(dirname "$SPOTDL_FILE")") - cd "$(dirname "$SPOTDL_FILE")" || continue spotdl sync "$(basename "$SPOTDL_FILE")" - notify "Synced $FOLDER_NAME" - fi + if [[ -f "$SPOTDL_FILE" && "$SPOTDL_FILE" == *.spotdl ]]; then + FOLDER_NAME=$(basename "$(dirname "$SPOTDL_FILE")") + cd "$(dirname "$SPOTDL_FILE")" || continue + notify "Synced $FOLDER_NAME" + fi done < <(find "$MUSIC_FOLDER" -mindepth 1 -maxdepth 3 -type f -name '*.spotdl' -print0) notify "Spotdl Sync Complete"