Moved leftover from audio to AutoArtistAdder

Moved leftover from audio to AutoArtistAdder
pull/154/head
Makario1337 2 years ago committed by GitHub
parent 53730b77df
commit b5c339a9c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
scriptVersion="1.0.006" scriptVersion="1.0.007"
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)"
if [ "$lidarrUrlBase" == "null" ]; then if [ "$lidarrUrlBase" == "null" ]; then
@ -317,6 +317,34 @@ AddTidalArtistToLidarr () {
done done
} }
LidarrMissingAlbumSearch () {
log "Begin searching for missing artist albums via Lidarr Indexers..."
lidarrArtistIds=$(echo $lidarrMissingAlbumArtistsData | jq -r .id)
lidarrArtistIdsCount=$(echo "$lidarrArtistIds" | wc -l)
processCount=0
for lidarrArtistId in $(echo $lidarrArtistIds); do
processCount=$(( $processCount + 1))
lidarrArtistData=$(echo $lidarrMissingAlbumArtistsData | jq -r "select(.id==$lidarrArtistId)")
lidarrArtistName=$(echo $lidarrArtistData | jq -r .artistName)
lidarrArtistMusicbrainzId=$(echo $lidarrArtistData | jq -r .foreignArtistId)
if [ -d /config/extended/logs/searched/lidarr/artist ]; then
if [ -f /config/extended/logs/searched/lidarr/artist/$lidarrArtistMusicbrainzId ]; then
log "$processCount of $lidarrArtistIdsCount :: Previously Notified Lidarr to search for \"$lidarrArtistName\" :: Skipping..."
continue
fi
fi
log "$processCount of $lidarrArtistIdsCount :: Notified Lidarr to search for \"$lidarrArtistName\""
startLidarrArtistSearch=$(curl -s "$lidarrUrl/api/v1/command" -X POST -H "Content-Type: application/json" -H "X-Api-Key: $lidarrApiKey" --data-raw "{\"name\":\"ArtistSearch\",\"artistId\":$lidarrArtistId}")
if [ ! -d /config/extended/logs/searched/lidarr/artist ]; then
mkdir -p /config/extended/logs/searched/lidarr/artist
chmod -R 777 /config/extended/logs/searched/lidarr/artist
fi
touch /config/extended/logs/searched/lidarr/artist/$lidarrArtistMusicbrainzId
chmod 777 /config/extended/logs/searched/lidarr/artist/$lidarrArtistMusicbrainzId
done
}
if [ -z $lidarrSearchForMissing ]; then if [ -z $lidarrSearchForMissing ]; then
lidarrSearchForMissing=true lidarrSearchForMissing=true
fi fi
@ -338,4 +366,8 @@ if [ "$addRelatedArtists" == "true" ]; then
AddTidalRelatedArtists AddTidalRelatedArtists
fi fi
if [ "$addDeezerTopArtists" == "true" ] || [ "$addDeezerTopAlbumArtists" == "true" ] || [ "$addDeezerTopTrackArtists" == "true" ] || [ "$addRelatedArtists" == "true" ]; then
LidarrMissingAlbumSearch
fi
exit exit

Loading…
Cancel
Save