From 76417c2a4fb54bdffd55a2f00d90ce66c63c9524 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Tue, 6 Dec 2022 10:49:26 -0500 Subject: [PATCH] 1.0.061 - Fallback to Musicbrainz for artistImvdbUrl --- root/scripts/Video.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/root/scripts/Video.sh b/root/scripts/Video.sh index c98bae2..0872d67 100644 --- a/root/scripts/Video.sh +++ b/root/scripts/Video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.060" +scriptVersion="1.0.061" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -627,6 +627,13 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do lidarrArtistNameSanitized="$(echo "$lidarrArtistFolderNoDisambig" | sed 's% (.*)$%%g')" artistImvdbUrl=$(echo $lidarrArtistData | jq -r '.links[] | select(.name=="imvdb") | .url') artistImvdbSlug=$(basename "$artistImvdbUrl") + + if [ -z "$artistImvdbUrl" ]; then + tempmbzartistinfo="$(curl -s -A "$agent" "$musicbrainzMirror/ws/2/artist/$lidarrArtistId?inc=url-rels+genres&fmt=json")" + sleep 1 + artistImvdbUrl="$(echo "$tempmbzartistinfo" | jq -r ".relations | .[] | .url | select(.resource | contains(\"imvdb\")) | .resource")" + artistImvdbSlug=$(basename "$artistImvdbUrl") + fi CacheMusicbrainzRecords ImvdbCache