From d8bd8e5d6fd640ca82af02f038c087449632ab89 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 18 Nov 2022 06:27:18 -0500 Subject: [PATCH] 1.0.012 - Bugfix for existing lrc removal.. --- root/scripts/MetadataPostProcess.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/root/scripts/MetadataPostProcess.bash b/root/scripts/MetadataPostProcess.bash index 8fa2409..6940b3a 100644 --- a/root/scripts/MetadataPostProcess.bash +++ b/root/scripts/MetadataPostProcess.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion=1.0.011 +scriptVersion=1.0.012 if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" == "null" ]; then @@ -46,6 +46,11 @@ else exit fi +if ls "$getFolderPath" | grep "lrc" | read; then + log "Removing existing lrc files" + find "$getFolderPath" -type f -iname "*.lrc" -delete +fi + find "$getFolderPath" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -print0 | while IFS= read -r -d '' file; do fileName=$(basename -- "$file") fileExt="${fileName##*.}" @@ -58,11 +63,6 @@ find "$getFolderPath" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -print0 | fi fi - if ls "$getFolderPath" | grep "lrc" | read; then - log "Removing existing lrc files" - find "$getFolderPath" -type f -iname "*.lrc" -delete - fi - if [ "$fileExt" == "flac" ]; then getLyrics="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$file" | jq -r ".format.tags.LYRICS" | sed "s/null//g" | sed "/^$/d")" getArtistCredit="$(ffprobe -loglevel 0 -print_format json -show_format -show_streams "$file" | jq -r ".format.tags.ARTIST_CREDIT" | sed "s/null//g" | sed "/^$/d")"