1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-21 23:32:27 +00:00

Remove non-audio media filter (#4123, #2084)

This commit is contained in:
John Regan 2023-09-17 09:33:18 -04:00
parent 85e62caccf
commit a48dd4456d

View file

@ -25,7 +25,6 @@ public class SkyHookProxy : IProvideArtistInfo, ISearchForNewArtist, IProvideAlb
private readonly IMetadataProfileService _metadataProfileService;
private readonly ICached<HashSet<string>> _cache;
private static readonly List<string> NonAudioMedia = new List<string> { "DVD", "DVD-Video", "Blu-ray", "HD-DVD", "VCD", "SVCD", "UMD", "VHS" };
private static readonly List<string> SkippedTracks = new List<string> { "[data track]" };
public SkyHookProxy(IHttpClient httpClient,
@ -496,11 +495,8 @@ private static AlbumRelease MapRelease(ReleaseResource resource, Dictionary<stri
}
}
// Skip non-audio media
var audioMediaNumbers = allMedia.Where(x => !NonAudioMedia.Contains(x.Format)).Select(x => x.Number);
// Get tracks on the audio media and omit any that are skipped
release.Tracks = allTracks.Where(x => audioMediaNumbers.Contains(x.MediumNumber) && !SkippedTracks.Contains(x.Title)).ToList();
release.Tracks = allTracks.Where(x => !SkippedTracks.Contains(x.Title)).ToList();
release.TrackCount = release.Tracks.Value.Count;
// Only include the media that contain the tracks we have selected