From 2a660e6c5b643790fc3e768bea8e105bcba15407 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 7 Nov 2022 07:58:26 -0500 Subject: [PATCH] 1.0.003 - Bug Fix for missing ALBUMARTIST tag --- root/scripts/BeetsPostProcessor.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/root/scripts/BeetsPostProcessor.bash b/root/scripts/BeetsPostProcessor.bash index 19d6170..d692704 100644 --- a/root/scripts/BeetsPostProcessor.bash +++ b/root/scripts/BeetsPostProcessor.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -version=1.0.002 +version=1.0.003 if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" == "null" ]; then @@ -31,7 +31,7 @@ if [ "$lidarr_eventtype" == "Test" ]; then exit 0 fi - +getAlbumArtist="$(curl -s "$lidarrUrl/api/v1/album/$lidarr_album_id" -H "X-Api-Key: ${lidarrApiKey}" | jq -r .artist.artistName)" getTrackPath="$(curl -s "$lidarrUrl/api/v1/trackFile?albumId=$lidarr_album_id" -H "X-Api-Key: ${lidarrApiKey}" | jq -r .[].path | head -n1)" getFolderPath="$(dirname "$getTrackPath")" @@ -65,6 +65,8 @@ ProcessWithBeets () { metaflac --remove-tag=ALBUM_ARTIST "$file" metaflac --remove-tag="ALBUM ARTIST" "$file" metaflac --remove-tag=ARTISTSORT "$file" + metaflac --set-tag=ALBUMARTIST="$getAlbumArtist" "$file" + done else log "$1 :: ERROR :: Unable to match using beets to a musicbrainz release..."