Fixed: MediaFileRepository was ignoring AlbumRelease monitored flag (#689)

This commit is contained in:
ta264
2019-03-23 08:37:34 +00:00
committed by GitHub
parent b557f620d9
commit 6e4b1ba1fe
2 changed files with 41 additions and 15 deletions
@@ -34,7 +34,7 @@ namespace NzbDrone.Core.MediaFiles
public List<TrackFile> GetFilesByArtist(int artistId)
{
return Query
.Join<Album, AlbumRelease>(JoinType.Inner, a => a.AlbumReleases, (a, r) => a.Id == r.AlbumId)
.Join<Track, AlbumRelease>(JoinType.Inner, t => t.AlbumRelease, (t, r) => t.AlbumReleaseId == r.Id)
.Where<AlbumRelease>(r => r.Monitored == true)
.AndWhere(t => t.Artist.Value.Id == artistId)
.ToList();
@@ -58,10 +58,9 @@ namespace NzbDrone.Core.MediaFiles
public List<TrackFile> GetFilesWithRelativePath(int artistId, string relativePath)
{
return Query
.Join<Album, AlbumRelease>(JoinType.Inner, a => a.AlbumReleases, (a, r) => a.Id == r.AlbumId)
.Join<Track, AlbumRelease>(JoinType.Inner, t => t.AlbumRelease, (t, r) => t.AlbumReleaseId == r.Id)
.Where<AlbumRelease>(r => r.Monitored == true)
.AndWhere(t => t.Artist.Value.Id == artistId)
.AndWhere(t => t.RelativePath == relativePath)
.AndWhere(t => t.Artist.Value.Id == artistId && t.RelativePath == relativePath)
.ToList();
}
}