@ -1,5 +1,5 @@
#!/usr/bin/env bash
scriptVersion = "1.0.17 2 "
scriptVersion = "1.0.17 3 "
lidarrUrlBase = " $( cat /config/config.xml | xq | jq -r .Config.UrlBase) "
if [ " $lidarrUrlBase " = "null" ] ; then
lidarrUrlBase = ""
@ -455,7 +455,7 @@ DownloadProcess () {
downloadedAlbumTitleClean = " $( echo " $4 " | sed -e "s%[^[:alpha:][:digit:]._' ]% %g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g' ) "
if find /downloads/lidarr-extended/complete -type d -iname " $lidarrArtistNameSanitized - $downloadedAlbumTitleClean ( $3 )-*- $ 2" | read; then
if find /downloads/lidarr-extended/complete -type d -iname " $lidarrArtistNameSanitized - $downloadedAlbumTitleClean ( $3 )-*- $ 1- $ 2" | read; then
log " :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: $lidarrAlbumType :: ERROR :: Previously Downloaded... "
return
fi
@ -665,7 +665,7 @@ DownloadProcess () {
done
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 ^^ } - $ 1- $ 2"
find "/downloads/lidarr-extended/incomplete" -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" -print0 | while IFS = read -r -d '' audio; do
file = " ${ audio } "
@ -686,7 +686,7 @@ DownloadProcess () {
chown -R abc:abc /downloads/lidarr-extended/complete
log " :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistNameSanitized :: $lidarrAlbumTitle :: $lidarrAlbumType :: Processing files with beets... "
ProcessWithBeets " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder " " ${ albumquality ^^ } " " $2 "
ProcessWithBeets " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder " " ${ albumquality ^^ } " " $2 " " $1 "
if [ -d " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder " ] ; then
NotifyLidarrForImport " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder "
@ -1824,6 +1824,11 @@ FuzzyTidalSearch () {
ProcessWithBeets ( ) {
# Input
# $1 Download Folder to process
# $2 Detected Quality
# $3 Download Client Used
# $4 Album ID
trackcount = $( find " $1 " -type f -regex ".*/.*\.\(flac\|opus\|m4a\|mp3\)" | wc -l)
@ -1949,7 +1954,7 @@ ProcessWithBeets () {
matchedLidarrAlbumArtistCleanName = " $( echo " $matchedLidarrAlbumArtistName " | sed -e "s%[^[:alpha:][:digit:]._()' -]% %g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g' ) "
downloadedAlbumFolder = " ${ matchedLidarrAlbumArtistCleanName } - ${ matchedTagsAlbumTitleClean } ( $matchedTagsAlbumYear )- ${ albumquality ^^ } - $ 3"
downloadedAlbumFolder = " ${ matchedLidarrAlbumArtistCleanName } - ${ matchedTagsAlbumTitleClean } ( $matchedTagsAlbumYear )- ${ albumquality ^^ } - $ 4- $ 3"
if [ " $1 " != " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder " ] ; then
if [ -d " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder " ] ; then
rm -rf " /downloads/lidarr-extended/complete/ $downloadedAlbumFolder "