1.0.204 - Add lidarrArtistForeignArtistId to notfound log file name

Adding the lidarrArtistForeignArtistId to the notfound ID, will allow using cli tools to delete all notfound ids from a particular artist. This is only for more advanced users that want to re-search a particular artist.
pull/35/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 8b4a4782ac
commit 0c3a23052d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.203"
scriptVersion="1.0.204"
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
if [ "$lidarrUrlBase" = "null" ]; then
lidarrUrlBase=""
@ -937,7 +937,7 @@ GetMissingCutOffList () {
lidarrRecords=$(wget --timeout=0 -q -O - "$lidarrUrl/api/v1/wanted/missing?page=$page&pagesize=$amountPerPull&sortKey=$searchOrder&sortDirection=$searchDirection&apikey=${lidarrApiKey}" | jq -r '.records[].id')
for lidarrRecordId in $(echo $lidarrRecords); do
if [ ! -f "/config/extended/logs/notfound/$lidarrRecordId" ]; then
if [ ! -f /config/extended/logs/notfound/$lidarrRecordId-* ]; then
touch /config/extended/cache/lidarr/list/${lidarrRecordId}-missing
fi
done
@ -962,7 +962,7 @@ GetMissingCutOffList () {
log ":: Downloading page $page... ($offset - $dlnumber of $lidarrCutoffTotalRecords Results)"
lidarrRecords=$(wget --timeout=0 -q -O - "$lidarrUrl/api/v1/wanted/cutoff?page=$page&pagesize=$amountPerPull&sortKey=$searchOrder&sortDirection=$searchDirection&apikey=${lidarrApiKey}" | jq -r '.records[].id')
for lidarrRecordId in $(echo $lidarrRecords); do
if [ ! -f "/config/extended/logs/notfound/$lidarrRecordId" ]; then
if [ ! -f /config/extended/logs/notfound/$lidarrRecordId-* ]; then
touch /config/extended/cache/lidarr/list/${lidarrRecordId}-cutoff
fi
done
@ -1000,6 +1000,8 @@ SearchProcess () {
checkLidarrAlbumId=$wantedAlbumId
wantedAlbumListSource=$(echo $lidarrMissingId | sed -e "s%[^[:alpha:]]%%g")
lidarrAlbumData="$(curl -s "$lidarrUrl/api/v1/album/$wantedAlbumId?apikey=${lidarrApiKey}")"
lidarrArtistData=$(echo "${lidarrAlbumData}" | jq -r ".artist")
lidarrArtistForeignArtistId=$(echo "${lidarrArtistData}" | jq -r ".foreignArtistId")
lidarrAlbumType=$(echo "$lidarrAlbumData" | jq -r ".albumType")
lidarrAlbumTitle=$(echo "$lidarrAlbumData" | jq -r ".title")
@ -1009,7 +1011,7 @@ SearchProcess () {
chown abc:abc /config/extended/logs/notfound
fi
if [ -f "/config/extended/logs/notfound/$wantedAlbumId" ]; then
if [ -f "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId" ]; then
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrAlbumTitle :: $lidarrAlbumType :: Previously Not Found, skipping..."
continue
fi
@ -1018,7 +1020,9 @@ SearchProcess () {
if [ -f "/config/extended/logs/downloaded/notfound/$lidarrAlbumForeignAlbumId" ]; then
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrAlbumTitle :: $lidarrAlbumType :: Previously Not Found, skipping..."
rm "/config/extended/logs/downloaded/notfound/$lidarrAlbumForeignAlbumId"
touch "/config/extended/logs/notfound/$wantedAlbumId"
touch "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId"
chmod 666 "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId"
chown abc:abc "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId"
continue
fi
@ -1337,10 +1341,10 @@ SearchProcess () {
chown abc:abc /config/extended/logs/notfound
fi
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: $lidarrAlbumType :: Marking Album as notfound"
if [ ! -f /config/extended/logs/notfound/$wantedAlbumId ]; then
touch /config/extended/logs/notfound/$wantedAlbumId
chmod 666 /config/extended/logs/notfound/$wantedAlbumId
chown abc:abc /config/extended/logs/notfound/$wantedAlbumId
if [ ! -f "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId" ]; then
touch "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId"
chmod 666 "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId"
chown abc:abc "/config/extended/logs/notfound/$wantedAlbumId-$lidarrArtistForeignArtistId"
fi
log ":: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: $lidarrAlbumType :: Search Complete..."
done

Loading…
Cancel
Save