Fixed: GetFilesByAlbum should only return files for monitored releases

Since switching releases doesn't clear out trackfiles for unmonitored
releases, we need to ensure we only return files for monitored
releases otherwise we will return duplicates
pull/6/head
ta264 6 years ago
parent 225af556d9
commit ef3005f2bb

@ -43,7 +43,9 @@ namespace NzbDrone.Core.MediaFiles
public List<TrackFile> GetFilesByAlbum(int albumId) public List<TrackFile> GetFilesByAlbum(int albumId)
{ {
return Query return Query
.Where(f => f.AlbumId == albumId) .Join<Track, AlbumRelease>(JoinType.Inner, t => t.AlbumRelease, (t, r) => t.AlbumReleaseId == r.Id)
.Where<AlbumRelease>(r => r.Monitored == true)
.AndWhere(f => f.AlbumId == albumId)
.ToList(); .ToList();
} }

Loading…
Cancel
Save