v2.0 - Clean/clear download folder between downloads

This commit is contained in:
RandomNinjaAtk 2024-08-08 10:33:24 +00:00 committed by GitHub
parent e3ad878bee
commit 754a6d0e08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
scriptVersion="1.9" scriptVersion="2.0"
scriptName="TidalVideoDownloader" scriptName="TidalVideoDownloader"
#### Import Settings #### Import Settings
@ -260,7 +260,10 @@ VideoProcess () {
videoArtists="$(echo "$videoData" | jq -r ".artists[]")" videoArtists="$(echo "$videoData" | jq -r ".artists[]")"
videoArtistsIds="$(echo "$videoArtists" | jq -r ".id")" videoArtistsIds="$(echo "$videoArtists" | jq -r ".id")"
videoType="" videoType=""
log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Processing..." # clean/clear download folder
rm -rf "$videoDownloadPath"/*
log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Processing..."
if echo "$videoTitle" | grep -i "official" | grep -i "video" | read; then if echo "$videoTitle" | grep -i "official" | grep -i "video" | read; then
log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Official Music Video Match Found!" log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Official Music Video Match Found!"
@ -496,6 +499,9 @@ VideoProcess () {
log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Logging completed download $id to: /config/extended/logs/tidal-video/$id" log "$processCount/$lidarrArtistCount :: $lidarrArtistName :: $tidalVideoProcessNumber/$tidalVideoIdsCount :: $videoTitle ($id) :: Logging completed download $id to: /config/extended/logs/tidal-video/$id"
touch /config/extended/logs/tidal-video/$id touch /config/extended/logs/tidal-video/$id
chmod 666 "/config/extended/logs/tidal-video/$id" chmod 666 "/config/extended/logs/tidal-video/$id"
# clean/clear download folder
rm -rf "$videoDownloadPath"/*
done done
done done
} }