v1.0.029 - Log completed artists, only retry every 7 days

This will speed up script runs by only processing new artists on subsequent runs until a 7 day time limit has passed...
pull/60/head
RandomNinjaAtk 2 years ago committed by GitHub
parent ab6e60c213
commit 82ece3f7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion="1.0.028"
scriptVersion="1.0.029"
if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then
lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)"
@ -560,12 +560,22 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
lidarrArtistNameSanitized="$(echo "$lidarrArtistFolder" | sed 's% (.*)$%%g')"
artistImvdbUrl=$(echo $lidarrArtistData | jq -r '.links[] | select(.name=="imvdb") | .url')
artistImvdbSlug=$(basename "$artistImvdbUrl")
downloadedVideoCount=0
if [ "$lidarrArtistName" == "Various Artists" ]; then
log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: Skipping, not processed by design..."
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: Skipping, not processed by design..."
continue
fi
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/$lidarrArtistFolder" ]; then
downloadedVideoCount=$(find "/music-videos/$lidarrArtistFolder" -type f -iname "*.mkv" | wc -l)
log "$processCount of $lidarrArtistIdsCount :: $lidarrArtistName :: All $downloadedVideoCount Artist Music Videos previously downloaded, skipping..."
continue
fi
fi
CacheMusicbrainzRecords
ImvdbCache
@ -770,6 +780,21 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do
mv $downloadPath/incomplete/* "/music-videos/$lidarrArtistFolder"/
done
if [ ! -d /config/extended/logs/video ]; then
mkdir -p /config/extended/logs/video
chmod 777 /config/extended/logs/video
chown abc:abc /config/extended/logs/video
fi
if [ ! -d /config/extended/logs/video/complete ]; then
mkdir -p /config/extended/logs/video/complete
chmod 777 /config/extended/logs/video/complete
chown abc:abc /config/extended/logs/video/complete
fi
touch "/config/extended/logs/video/complete/$lidarrArtistFolder"
done
#CacheMusicbrainzRecords

Loading…
Cancel
Save