|
1 | 1 | #!/usr/bin/with-contenv bash |
2 | | -scriptVersion="2.45" |
| 2 | +scriptVersion="2.46" |
3 | 3 | scriptName="Audio" |
4 | 4 |
|
5 | 5 | ### Import Settings |
@@ -842,28 +842,16 @@ ProcessWithBeets () { |
842 | 842 | touch "/config/extended/logs/downloaded/musicbrainz_matched/$matchedTagsAlbumReleaseGroupId" |
843 | 843 |
|
844 | 844 | 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)" |
852 | 853 | return |
853 | 854 | 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 | | - |
867 | 855 |
|
868 | 856 | } |
869 | 857 |
|
@@ -1743,36 +1731,6 @@ FuzzyTidalSearch () { |
1743 | 1731 | fi |
1744 | 1732 | } |
1745 | 1733 |
|
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 | | - |
1776 | 1734 | LidarrTaskStatusCheck () { |
1777 | 1735 | alerted=no |
1778 | 1736 | until false |
|
0 commit comments