From 90fee7fc18af6edf98d04008d230ab6983d5bedd Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Mon, 6 Mar 2023 11:17:33 -0500 Subject: [PATCH] 1.0.069 - Improve duplicate checking by ignoring filename case-sensitivity #208 - Attempt to prevent dupes by ignoring filename case-sensitivity --- root/scripts/Video.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/root/scripts/Video.sh b/root/scripts/Video.sh index c2e3424..047bb03 100644 --- a/root/scripts/Video.sh +++ b/root/scripts/Video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.068" +scriptVersion="1.0.069" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -749,7 +749,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do fi fi fi - if [ -f "$videoPath/$lidarrArtistFolderNoDisambig/${musicbrainzVideoTitleClean}${plexVideoType}.mkv" ]; then + if [[ -n $(find "$videoPath/$lidarrArtistFolderNoDisambig" -maxdepth 1 -iname "${musicbrainzVideoTitleClean}${plexVideoType}.mkv") ]]; then log "$processCount of $lidarrArtistIdsCount :: MBZDB :: $lidarrArtistName :: ${musicbrainzVideoTitle}${musicbrainzVideoDisambiguation} :: Previously Downloaded, skipping..." continue fi @@ -838,15 +838,7 @@ for lidarrArtistId in $(echo $lidarrArtistIds); do tidy -w 2000 -i -m -xml "$videoPath/$lidarrArtistFolderNoDisambig/${videoTitleClean}${plexVideoType}.nfo" &>/dev/null fi fi - if [ -f "$videoPath/$lidarrArtistFolderNoDisambig/${videoTitleClean}${plexVideoType}.nfo" ]; then - if cat "$videoPath/$lidarrArtistFolderNoDisambig/${videoTitleClean}${plexVideoType}.nfo" | grep "source" | read; then - sleep 0 - else - log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${videoTitleClean} :: NFO Missing Source information, purging for re-processing..." - rm "$videoPath/$lidarrArtistFolderNoDisambig/${videoTitleClean}${plexVideoType}"* - fi - fi - if [ -f "$videoPath/$lidarrArtistFolderNoDisambig/${videoTitleClean}${plexVideoType}.mkv" ]; then + if [[ -n $(find "$videoPath/$lidarrArtistFolderNoDisambig" -maxdepth 1 -iname "${videoTitleClean}${plexVideoType}.mkv") ]]; then log "$processCount of $lidarrArtistIdsCount :: IMVDB :: $lidarrArtistName :: ${imvdbVideoTitle} :: Previously Downloaded, skipping..." continue fi