@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion = "1.0.03 4 "
scriptVersion = "1.0.03 5 "
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