v3.1 - Only cache artist once every 7 days, improved logging

This commit is contained in:
RandomNinjaAtk 2023-08-01 12:22:03 +00:00 committed by GitHub
parent e0ae9e3379
commit b702d9e251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
scriptVersion="3.0" scriptVersion="3.1"
scriptName="Video" scriptName="Video"
### Import Settings ### Import Settings
@ -526,23 +526,32 @@ VideoProcess () {
artistImvdbSlug=$(basename "$artistImvdbUrl") artistImvdbSlug=$(basename "$artistImvdbUrl")
if [ ! -z "$artistImvdbSlug" ]; then if [ ! -z "$artistImvdbSlug" ]; then
log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: IMVDB Slug :: $artistImvdbSlug" log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: IMVDB :: Slug :: $artistImvdbSlug"
else else
log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: IMVDB Slug Not Found..." log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: IMVDB :: ERROR :: Slug Not Found, skipping..."
continue continue
fi fi
ImvdbCache if [ -d /config/extended/logs/video/complete ]; then
if [ -f "/config/extended/logs/video/complete/$lidarrArtistMusicbrainzId" ]; then
# Only update cache for artist if the completed log file is older than 7 days...
if [[ $(find "/config/extended/logs/video/complete/$lidarrArtistMusicbrainzId" -mtime +7 -print) ]]; then
ImvdbCache
fi
fi
else
# Always run cache process if completed log folder does not exist
ImvdbCache
fi
if [ -d /config/extended/logs/video/complete ]; then if [ -d /config/extended/logs/video/complete ]; then
# If completed log file found for artist, end processing and skip...
if [ -f "/config/extended/logs/video/complete/$lidarrArtistMusicbrainzId" ]; then if [ -f "/config/extended/logs/video/complete/$lidarrArtistMusicbrainzId" ]; then
log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: Music Videos previously downloaded, skipping..." log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: Music Videos previously downloaded, skipping..."
continue continue
fi fi
fi fi
if [ -z "$artistImvdbSlug" ]; then if [ -z "$artistImvdbSlug" ]; then
log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: IMVDB :: No IMVDB artist link found, skipping..." log "${processCount}/${lidarrArtistIdsCount} :: $lidarrArtistName :: IMVDB :: No IMVDB artist link found, skipping..."
# Create log of missing IMVDB url... # Create log of missing IMVDB url...