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..."