From 0515266dfb0224eedc2195dd696c89d64550bdd4 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 29 Jul 2022 19:16:24 +0000 Subject: [PATCH] v1.0.007 - Bug fix, and re-order process, add logging --- root/scripts/video.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/root/scripts/video.sh b/root/scripts/video.sh index 8fe70d9..ca9bbfd 100644 --- a/root/scripts/video.sh +++ b/root/scripts/video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.006" +scriptVersion="1.0.007" lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" = "null" ]; then lidarrUrlBase="" @@ -194,7 +194,7 @@ CacheMusicbrainzRecords () { - if [ -f "/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}-$plexVideoType.mkv" ]; then + if [ -f "/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv" ]; then log "$processCount of $lidarrArtistIdsCount :: MBZDB CACHE :: $lidarrArtistName :: ${musibrainzVideoTitle}${musibrainzVideoDisambiguation} :: Previously Downloaded, skipping..." continue fi @@ -296,13 +296,12 @@ CacheMusicbrainzRecords () { chown abc:abc "/music-videos/$lidarrArtistFolder" fi - log "$processCount of $lidarrArtistIdsCount :: MBZDB CACHE :: $lidarrArtistName :: ${musibrainzVideoTitle}${musibrainzVideoDisambiguation} :: Moving completed download to: /music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv" - mv "$filenoext.mkv" "/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv" + if [ -f "$downloadPath/incomplete/${musibrainzVideoTitleClean}${plexVideoType}.jpg" ]; then mv "$downloadPath/incomplete/${musibrainzVideoTitleClean}${plexVideoType}.jpg" "/music-videos/$lidarrArtistFolder"/ fi - + log "$processCount of $lidarrArtistIdsCount :: MBZDB CACHE :: $lidarrArtistName :: ${musibrainzVideoTitle}${musibrainzVideoDisambiguation} :: Writing NFO" nfo="/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.nfo" echo "" >> "$nfo" echo " ${musibrainzVideoTitle}${videoDisambiguationTitle}" >> "$nfo" @@ -329,6 +328,8 @@ CacheMusicbrainzRecords () { fi echo "" >> "$nfo" + log "$processCount of $lidarrArtistIdsCount :: MBZDB CACHE :: $lidarrArtistName :: ${musibrainzVideoTitle}${musibrainzVideoDisambiguation} :: Moving completed download to: /music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv" + mv "$filenoext.mkv" "/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv" if [ -f "/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv" ]; then chmod 666 "/music-videos/$lidarrArtistFolder/${musibrainzVideoTitleClean}${plexVideoType}.mkv"