Update download.sh

pull/6/head
RandomNinjaAtk 2 years ago committed by GitHub
parent 42cd7ff3e8
commit fd98a96870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -123,19 +123,19 @@ DownloadProcess () {
return return
fi fi
albumquality="$(find /downloads/lidarr/incomplete/ -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | head -n 1 | egrep -i -E -o "\.{1}\w*$" | sed 's/\.//g')" albumquality="$(find /downloads/lidarr-extended/incomplete/ -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | head -n 1 | egrep -i -E -o "\.{1}\w*$" | sed 's/\.//g')"
downloadedAlbumFolder="$lidarrArtistNameSanitized-$downloadedAlbumTitleClean ($3)-${albumquality^^}-$2" downloadedAlbumFolder="$lidarrArtistNameSanitized-$downloadedAlbumTitleClean ($3)-${albumquality^^}-$2"
find "/downloads/lidarr/incomplete" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -print0 | while IFS= read -r -d '' audio; do find "/downloads/lidarr-extended/incomplete" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -print0 | while IFS= read -r -d '' audio; do
file="${audio}" file="${audio}"
filenoext="${file%.*}" filenoext="${file%.*}"
filename="$(basename "$audio")" filename="$(basename "$audio")"
extension="${filename##*.}" extension="${filename##*.}"
filenamenoext="${filename%.*}" filenamenoext="${filename%.*}"
if [ ! -d "/downloads/lidarr/complete" ]; then if [ ! -d "/downloads/lidarr-extended/complete" ]; then
mkdir -p /downloads/lidarr/complete mkdir -p /downloads/lidarr-extended/complete
chmod 777 /downloads/lidarr/complete chmod 777 /downloads/lidarr-extended/complete
chown abc:abc /downloads/lidarr/complete chown abc:abc /downloads/lidarr-extended/complete
fi fi
mkdir -p "/downloads/lidarr-extended/complete/$downloadedAlbumFolder" mkdir -p "/downloads/lidarr-extended/complete/$downloadedAlbumFolder"
mv "$file" "/downloads/lidarr-extended/complete/$downloadedAlbumFolder"/ mv "$file" "/downloads/lidarr-extended/complete/$downloadedAlbumFolder"/

Loading…
Cancel
Save