From 7a0fc5d37c9691acc77e3bf38d7d7f656f1b1275 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Thu, 17 Nov 2022 18:47:02 +0000 Subject: [PATCH] 1.0.282 - Attempt to import 3 times, before failing and moving on... Sometimes lidarr will timeout connecting to various services and prevent an import due connection issues. So making 3 attempts to import is a workaround... --- root/scripts/Audio.sh | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/root/scripts/Audio.sh b/root/scripts/Audio.sh index d854e01..4bc46e3 100644 --- a/root/scripts/Audio.sh +++ b/root/scripts/Audio.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.281" +scriptVersion="1.0.282" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" == "null" ]; then @@ -765,9 +765,40 @@ DownloadProcess () { if [ -d "$downloadPath/complete/$downloadedAlbumFolder" ]; then NotifyLidarrForImport "$downloadPath/complete/$downloadedAlbumFolder" + + LidarrTaskStatusCheck + CheckLidarrBeforeImport "$checkLidarrAlbumId" + if [ "$alreadyImported" == "true" ]; then + log "$processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Already Imported, skipping..." + rm -rf "$downloadPath"/incomplete/* + fi + fi + + if [ -d "$downloadPath/complete/$downloadedAlbumFolder" ]; then + NotifyLidarrForImport "$downloadPath/complete/$downloadedAlbumFolder" + + LidarrTaskStatusCheck + CheckLidarrBeforeImport "$checkLidarrAlbumId" + if [ "$alreadyImported" == "true" ]; then + log "$processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Already Imported, skipping..." + rm -rf "$downloadPath"/incomplete/* + fi + fi + + if [ -d "$downloadPath/complete/$downloadedAlbumFolder" ]; then + NotifyLidarrForImport "$downloadPath/complete/$downloadedAlbumFolder" + + LidarrTaskStatusCheck + CheckLidarrBeforeImport "$checkLidarrAlbumId" + if [ "$alreadyImported" == "true" ]; then + log "$processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Already Imported, skipping..." + rm -rf "$downloadPath"/incomplete/* + fi fi - rm -rf "$downloadPath"/incomplete/* + if [ -d "$downloadPath/complete/$downloadedAlbumFolder" ]; then + rm -rf "$downloadPath"/incomplete/* + fi # NotifyPlexToScan }