v1.0.035 - Bug Fix for not marking artist as complete

pull/60/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 74bec50e20
commit e2f3f02f2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.034"
scriptVersion="1.0.035"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
@ -581,8 +581,11 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
if [ -d /config/extended/logs/video/complete ]; then
find /config/extended/logs/video/complete -type f -mtime +7 -delete # Remove Files older than 7 days to allow re-processing artist for new videos
if [ -f "/config/extended/logs/video/complete/$lidarrArtistMusicbrainzId" ]; then
downloadedVideoCount=0
if [ -d "$videoPath/$lidarrArtistFolder" ]; then
downloadedVideoCount=$(find "$videoPath/$lidarrArtistFolder" -type f -iname "*.mkv" | wc -l)
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: All $downloadedVideoCount Artist Music Videos previously downloaded, skipping..."
fi
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: $downloadedVideoCount Artist Music Videos previously downloaded, skipping..."
continue
fi
fi
@ -596,11 +599,11 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: $musicbrainzArtistVideoRecordingsCount videos found..."
musicbrainzArtistVideoRecordingsDataWithUrl=$(echo "$musicbrainzArtistVideoRecordings" | jq -r "select(.relations[].url)" | jq -s "." | jq -r "unique | .[] | select(.disambiguation | test(\"official\";\"i\"))")
musicbrainzArtistVideoRecordingsDataWithUrlIds=$(echo "$musicbrainzArtistVideoRecordingsDataWithUrl" | jq -r ".id")
musicbrainzArtistVideoRecordingsDataWithUrlIdsCount=$(echo "$musicbrainzArtistVideoRecordingsDataWithUrlIds" | wc -l)
musicbrainzArtistVideoRecordingsDataWithUrlIdsCount=$(echo -n "$musicbrainzArtistVideoRecordingsDataWithUrlIds" | wc -l)
log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: $musicbrainzArtistVideoRecordingsDataWithUrlIdsCount \"Official\" videos found with URL..."
if [ $musicbrainzArtistVideoRecordingsDataWithUrlIdsCount = 0 ]; then
log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: ERROR :: No vidoes with URLs to process, skipping..."
log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: No vidoes with URLs to process, skipping..."
else
for musicbrainzVideoId in $(echo "$musicbrainzArtistVideoRecordingsDataWithUrlIds"); do
@ -700,14 +703,14 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
if [ -z "$artistImvdbSlug" ]; then
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: No IMVDB artist link found, skipping..."
continue
fi
else
imvdbArtistVideoCount=$(ls /config/extended/cache/imvdb/$lidarrArtistMusicbrainzId--*.json | wc -l)
if [ $imvdbArtistVideoCount = 0 ]; then
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: No videos found, skipping..."
continue
fi
else
log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: Processing $imvdbArtistVideoCount Videos!"
find /config/extended/cache/imvdb -type f -empty -delete # delete empty files
@ -788,6 +791,10 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
mv $downloadPath/incomplete/* "$videoPath/$lidarrArtistFolder"/
done
fi
fi
if [ ! -d /config/extended/logs/video ]; then
mkdir -p /config/extended/logs/video
chmod 777 /config/extended/logs/video

Loading…
Cancel
Save