Skip to content

Commit ceb8a1b

Browse files
v.2.46 - Removed unused function, might have resolved memory leak...
#269 - Resolves this?
1 parent 193f168 commit ceb8a1b

File tree

1 file changed

+9
-51
lines changed

1 file changed

+9
-51
lines changed

lidarr/Audio.service.bash

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/with-contenv bash
2-
scriptVersion="2.45"
2+
scriptVersion="2.46"
33
scriptName="Audio"
44

55
### Import Settings
@@ -842,28 +842,16 @@ ProcessWithBeets () {
842842
touch "/config/extended/logs/downloaded/musicbrainz_matched/$matchedTagsAlbumReleaseGroupId"
843843

844844
fi
845-
846-
getLidarrAlbumId=$(curl -s "$arrUrl/api/v1/search?term=lidarr%3A${matchedTagsAlbumReleaseGroupId}&apikey=$arrApiKey" | jq -r .[].album.releases[].albumId | sort -u)
847-
checkLidarrAlbumData="$(curl -s "$arrUrl/api/v1/album/$getLidarrAlbumId?apikey=${arrApiKey}")"
848-
checkLidarrAlbumPercentOfTracks=$(echo "$checkLidarrAlbumData" | jq -r ".statistics.percentOfTracks")
849-
850-
if [ "$checkLidarrAlbumPercentOfTracks" = "null" ]; then
851-
checkLidarrAlbumPercentOfTracks=0
845+
846+
if [ "$wantedAlbumListSource" == "missing" ]; then
847+
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: ERROR :: Already Imported Album (Missing)"
848+
rm -rf "$audioPath/incomplete"/*
849+
touch /config/extended/beets-error
850+
return
851+
else
852+
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Importing Album (Cutoff)"
852853
return
853854
fi
854-
855-
if [ ${checkLidarrAlbumPercentOfTracks%%.*} -ge 100 ]; then
856-
if [ "$wantedAlbumListSource" == "missing" ]; then
857-
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: ERROR :: Already Imported Album (Missing)"
858-
rm -rf "$audioPath/incomplete"/*
859-
touch /config/extended/beets-error
860-
return
861-
else
862-
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Importing Album (Cutoff)"
863-
return
864-
fi
865-
fi
866-
867855

868856
}
869857

@@ -1743,36 +1731,6 @@ FuzzyTidalSearch () {
17431731
fi
17441732
}
17451733

1746-
CheckLidarrBeforeImport () {
1747-
1748-
alreadyImported=false
1749-
checkLidarrAlbumData="$(curl -s "$arrUrl/api/v1/album/$1?apikey=${arrApiKey}")"
1750-
checkLidarrAlbumPercentOfTracks=$(echo "$checkLidarrAlbumData" | jq -r ".statistics.percentOfTracks")
1751-
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Checking Lidarr for existing files"
1752-
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: $checkLidarrAlbumPercentOfTracks% Tracks found"
1753-
if [ "$checkLidarrAlbumPercentOfTracks" == "null" ]; then
1754-
checkLidarrAlbumPercentOfTracks=0
1755-
return
1756-
fi
1757-
if [ "${checkLidarrAlbumPercentOfTracks%%.*}" -ge "100" ]; then
1758-
if [ "$wantedAlbumListSource" == "missing" ]; then
1759-
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Already Imported Album (Missing), skipping..."
1760-
alreadyImported=true
1761-
return
1762-
fi
1763-
1764-
if [ "$wantedAlbumListSource" == "cutoff" ]; then
1765-
checkLidarrAlbumFiles="$(curl -s "$arrUrl/api/v1/trackFile?albumId=$1?apikey=${arrApiKey}")"
1766-
checkLidarrAlbumQualityCutoffNotMet=$(echo "$checkLidarrAlbumFiles" | jq -r ".[].qualityCutoffNotMet")
1767-
if echo "$checkLidarrAlbumQualityCutoffNotMet" | grep "true" | read; then
1768-
log "$page :: $wantedAlbumListSource :: $processNumber of $wantedListAlbumTotal :: $lidarrArtistName :: $lidarrAlbumTitle :: $lidarrAlbumType :: Already Imported Album (CutOff - $checkLidarrAlbumQualityCutoffNotMet), skipping..."
1769-
alreadyImported=true
1770-
return
1771-
fi
1772-
fi
1773-
fi
1774-
}
1775-
17761734
LidarrTaskStatusCheck () {
17771735
alerted=no
17781736
until false

0 commit comments

Comments
 (0)