|
|
@ -1,5 +1,5 @@
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
scriptVersion="1.0.061"
|
|
|
|
scriptVersion="1.0.062"
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
|
|
|
|
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
|
|
|
|
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
|
|
|
|
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
|
|
|
@ -625,16 +625,23 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
|
|
|
|
lidarrArtistFolder="$(basename "${lidarrArtistPath}")"
|
|
|
|
lidarrArtistFolder="$(basename "${lidarrArtistPath}")"
|
|
|
|
lidarrArtistFolderNoDisambig="$(echo "$lidarrArtistFolder" | sed "s/ (.*)$//g" | sed "s/\.$//g")" # Plex Sanitization, remove disambiguation
|
|
|
|
lidarrArtistFolderNoDisambig="$(echo "$lidarrArtistFolder" | sed "s/ (.*)$//g" | sed "s/\.$//g")" # Plex Sanitization, remove disambiguation
|
|
|
|
lidarrArtistNameSanitized="$(echo "$lidarrArtistFolderNoDisambig" | sed 's% (.*)$%%g')"
|
|
|
|
lidarrArtistNameSanitized="$(echo "$lidarrArtistFolderNoDisambig" | sed 's% (.*)$%%g')"
|
|
|
|
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: Checking for IMVDB Slug"
|
|
|
|
artistImvdbUrl=$(echo $lidarrArtistData | jq -r '.links[] | select(.name=="imvdb") | .url')
|
|
|
|
artistImvdbUrl=$(echo $lidarrArtistData | jq -r '.links[] | select(.name=="imvdb") | .url')
|
|
|
|
artistImvdbSlug=$(basename "$artistImvdbUrl")
|
|
|
|
artistImvdbSlug=$(basename "$artistImvdbUrl")
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$artistImvdbUrl" ]; then
|
|
|
|
if [ -z "$artistImvdbSlug" ]; then
|
|
|
|
tempmbzartistinfo="$(curl -s -A "$agent" "$musicbrainzMirror/ws/2/artist/$lidarrArtistId?inc=url-rels+genres&fmt=json")"
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: IMVDB Slug Not Found..."
|
|
|
|
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: Fallback to Musicbrainz for IMVDB Slug"
|
|
|
|
|
|
|
|
tempmbzartistinfo="$(curl -s -A "$agent" "$musicbrainzMirror/ws/2/artist/$lidarrArtistMusicbrainzId?inc=url-rels+genres&fmt=json")"
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
artistImvdbUrl="$(echo "$tempmbzartistinfo" | jq -r ".relations | .[] | .url | select(.resource | contains(\"imvdb\")) | .resource")"
|
|
|
|
artistImvdbUrl="$(echo "$tempmbzartistinfo" | jq -r ".relations | .[] | .url | select(.resource | contains(\"imvdb\")) | .resource")"
|
|
|
|
artistImvdbSlug=$(basename "$artistImvdbUrl")
|
|
|
|
artistImvdbSlug=$(basename "$artistImvdbUrl")
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! -z "$artistImvdbSlug" ]; then
|
|
|
|
|
|
|
|
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: IMVDB Slug :: $artistImvdbSlug"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
CacheMusicbrainzRecords
|
|
|
|
CacheMusicbrainzRecords
|
|
|
|
ImvdbCache
|
|
|
|
ImvdbCache
|
|
|
|
|
|
|
|
|
|
|
|