@ -1,5 +1,5 @@
#!/usr/bin/env bash
#!/usr/bin/env bash
scriptVersion = "1.0.24 7 "
scriptVersion = "1.0.24 8 "
if [ -z " $lidarrUrl " ] || [ -z " $lidarrApiKey " ] ; then
if [ -z " $lidarrUrl " ] || [ -z " $lidarrApiKey " ] ; then
lidarrUrlBase = " $( cat /config/config.xml | xq | jq -r .Config.UrlBase) "
lidarrUrlBase = " $( cat /config/config.xml | xq | jq -r .Config.UrlBase) "
if [ " $lidarrUrlBase " = = "null" ] ; then
if [ " $lidarrUrlBase " = = "null" ] ; then
@ -29,6 +29,7 @@ musicbrainzMirror=https://musicbrainz.org
#requireQuality="true"
#requireQuality="true"
#searchSort="album"
#searchSort="album"
#arlToken=""
#arlToken=""
#matchDistance=10
sleepTimer = 0.5
sleepTimer = 0.5
@ -153,6 +154,8 @@ Configuration () {
else
else
log "Replaygain Tagging Disabled"
log "Replaygain Tagging Disabled"
fi
fi
log " Match Distance: $matchDistance "
}
}
@ -1492,7 +1495,7 @@ ArtistDeezerSearch () {
deezerAlbumTitleClean = " $( echo ${ deezerAlbumTitle } | sed -e "s%[^[:alpha:][:digit:]]%%g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g' ) "
deezerAlbumTitleClean = " $( echo ${ deezerAlbumTitle } | sed -e "s%[^[:alpha:][:digit:]]%%g" -e "s/ */ /g" | sed 's/^[.]*//' | sed 's/[.]*$//g' | sed 's/^ *//g' | sed 's/ *$//g' ) "
# String Character Count test, quicker than the levenshtein method to allow faster processing
# String Character Count test, quicker than the levenshtein method to allow faster processing
characterMath = $(( ${# deezerAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
characterMath = $(( ${# deezerAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
if [ " $characterMath " -gt " 5 " ] ; then
if [ " $characterMath " -gt " $matchDistance " ] ; then
continue
continue
elif [ " $characterMath " -lt "0" ] ; then
elif [ " $characterMath " -lt "0" ] ; then
continue
continue
@ -1519,7 +1522,7 @@ ArtistDeezerSearch () {
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Calculating Similarity... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Calculating Similarity... "
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ deezerAlbumTitleClean ,, } " 2>/dev/null)
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ deezerAlbumTitleClean ,, } " 2>/dev/null)
if [ " $diff " -le " 5 " ] ; then
if [ " $diff " -le " $matchDistance " ] ; then
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Deezer MATCH Found :: Calculated Difference = $diff "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Deezer MATCH Found :: Calculated Difference = $diff "
# Execute Download
# Execute Download
@ -1581,7 +1584,7 @@ FuzzyDeezerSearch () {
# String Character Count test, quicker than the levenshtein method to allow faster processing
# String Character Count test, quicker than the levenshtein method to allow faster processing
characterMath = $(( ${# deezerAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
characterMath = $(( ${# deezerAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
if [ " $characterMath " -gt " 5 " ] ; then
if [ " $characterMath " -gt " $matchDistance " ] ; then
continue
continue
elif [ " $characterMath " -lt "0" ] ; then
elif [ " $characterMath " -lt "0" ] ; then
continue
continue
@ -1613,7 +1616,7 @@ FuzzyDeezerSearch () {
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Calculating Similarity... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Calculating Similarity... "
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ deezerAlbumTitleClean ,, } " 2>/dev/null)
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ deezerAlbumTitleClean ,, } " 2>/dev/null)
if [ " $diff " -le " 5 " ] ; then
if [ " $diff " -le " $matchDistance " ] ; then
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Deezer MATCH Found :: Calculated Difference = $diff "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $deezerAlbumTitleClean :: Deezer MATCH Found :: Calculated Difference = $diff "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: Downloading $deezerAlbumTrackCount Tracks :: $deezerAlbumTitle ( $downloadedReleaseYear ) "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Deezer :: $type :: $lidarrReleaseTitle :: Downloading $deezerAlbumTrackCount Tracks :: $deezerAlbumTitle ( $downloadedReleaseYear ) "
@ -1689,7 +1692,7 @@ ArtistTidalSearch () {
# String Character Count test, quicker than the levenshtein method to allow faster processing
# String Character Count test, quicker than the levenshtein method to allow faster processing
characterMath = $(( ${# tidalAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
characterMath = $(( ${# tidalAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
if [ " $characterMath " -gt " 5 " ] ; then
if [ " $characterMath " -gt " $matchDistance " ] ; then
continue
continue
elif [ " $characterMath " -lt "0" ] ; then
elif [ " $characterMath " -lt "0" ] ; then
continue
continue
@ -1698,7 +1701,7 @@ ArtistTidalSearch () {
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Calculating Similarity... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Calculating Similarity... "
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ tidalAlbumTitleClean ,, } " 2>/dev/null)
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ tidalAlbumTitleClean ,, } " 2>/dev/null)
if [ " $diff " -le " 5 " ] ; then
if [ " $diff " -le " $matchDistance " ] ; then
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Tidal MATCH Found :: Calculated Difference = $diff "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Artist Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Tidal MATCH Found :: Calculated Difference = $diff "
# Execute Download
# Execute Download
@ -1764,7 +1767,7 @@ FuzzyTidalSearch () {
# String Character Count test, quicker than the levenshtein method to allow faster processing
# String Character Count test, quicker than the levenshtein method to allow faster processing
characterMath = $(( ${# tidalAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
characterMath = $(( ${# tidalAlbumTitleClean } - ${# lidarrAlbumReleaseTitleClean } ))
if [ " $characterMath " -gt " 5 " ] ; then
if [ " $characterMath " -gt " $matchDistance " ] ; then
continue
continue
elif [ " $characterMath " -lt "0" ] ; then
elif [ " $characterMath " -lt "0" ] ; then
continue
continue
@ -1773,7 +1776,7 @@ FuzzyTidalSearch () {
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Checking for Match... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Calculating Similarity... "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Calculating Similarity... "
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ tidalAlbumTitleClean ,, } " 2>/dev/null)
diff = $( levenshtein " ${ lidarrAlbumReleaseTitleClean ,, } " " ${ tidalAlbumTitleClean ,, } " 2>/dev/null)
if [ " $diff " -le " 5 " ] ; then
if [ " $diff " -le " $matchDistance " ] ; then
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Tidal MATCH Found :: Calculated Difference = $diff "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: $lidarrAlbumReleaseTitleClean vs $tidalAlbumTitleClean :: Tidal MATCH Found :: Calculated Difference = $diff "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: Downloading $downloadedTrackCount Tracks :: $tidalAlbumTitle ( $downloadedReleaseYear ) "
log " $1 :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Fuzzy Search :: Tidal :: $type :: $lidarrReleaseTitle :: Downloading $downloadedTrackCount Tracks :: $tidalAlbumTitle ( $downloadedReleaseYear ) "