From 3b2c099972d6f007611c4104169c7bfbe0775c9b Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Fri, 17 Jun 2022 18:32:09 +0000 Subject: [PATCH] 1.0.0022 - cache ablum list once per run --- root/scripts/download.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/root/scripts/download.sh b/root/scripts/download.sh index 90f5648..cae6cb9 100644 --- a/root/scripts/download.sh +++ b/root/scripts/download.sh @@ -36,7 +36,7 @@ Configuration () { log "" sleep 2 log "############# $dockerTitle" - log "############# SCRIPT VERSION 1.0.0021" + log "############# SCRIPT VERSION 1.0.0022" log "############# DOCKER VERSION $dockerVersion" if [ -z $topLimit ]; then @@ -283,6 +283,10 @@ TidalClientSetup () { log ":: TIDAL :: ERROR :: Loading client for required authentication, please authenticate, then exit the client..." tidal-dl fi + + if [ -d /config/extended/cache/tidal ]; then + find /config/extended/cache/deezer -type f -name "*.json" -delete + fi } DownloadProcess () { @@ -406,6 +410,9 @@ DeemixClientSetup () { else log ":: DEEZER :: ERROR :: arlToken setting invalid, currently set to: $arlToken" fi + if [ -d /config/extended/cache/deezer ]; then + find /config/extended/cache/deezer -type f -name "*-albums.json" -delete + fi } ConfigureLidarrWithOptimalSettings () { @@ -572,9 +579,7 @@ SearchProcess () { if [ ! -d /config/extended/cache/tidal ]; then mkdir -p /config/extended/cache/tidal fi - - find /config/extended/cache/tidal -type f -mtime +7 -delete - + if [ ! -f /config/extended/cache/tidal/$tidalArtistId-videos.json ]; then curl -s "https://api.tidal.com/v1/artists/${tidalArtistId}/videos?limit=10000&countryCode=$CountryCode&filter=ALL" -H 'x-tidal-token: CzET4vdadNUFQ5JU' > /config/extended/cache/tidal/$tidalArtistId-videos.json fi