aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Reports/ReportsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/Reports/ReportsService.cs')
-rw-r--r--MediaBrowser.Api/Reports/ReportsService.cs63
1 files changed, 12 insertions, 51 deletions
diff --git a/MediaBrowser.Api/Reports/ReportsService.cs b/MediaBrowser.Api/Reports/ReportsService.cs
index 5dc6e2d84..15bdf4be6 100644
--- a/MediaBrowser.Api/Reports/ReportsService.cs
+++ b/MediaBrowser.Api/Reports/ReportsService.cs
@@ -350,6 +350,18 @@ namespace MediaBrowser.Api.Reports
query.MaxParentalRating = _localization.GetRatingLevel(request.MinOfficialRating);
}
+ // Artists
+ if (!string.IsNullOrEmpty(request.Artists))
+ {
+ query.ArtistNames = request.Artists.Split('|');
+ }
+
+ // Albums
+ if (!string.IsNullOrEmpty(request.Albums))
+ {
+ query.AlbumNames = request.Albums.Split('|');
+ }
+
if (request.HasQueryLimit == false)
{
query.StartIndex = null;
@@ -378,57 +390,6 @@ namespace MediaBrowser.Api.Reports
}
}
- // Artists
- if (!string.IsNullOrEmpty(request.Artists))
- {
- var artists = request.Artists.Split('|');
-
- var audio = i as IHasArtist;
-
- if (!(audio != null && artists.Any(audio.HasAnyArtist)))
- {
- return false;
- }
- }
-
- // Albums
- if (!string.IsNullOrEmpty(request.Albums))
- {
- var albums = request.Albums.Split('|');
-
- var audio = i as Audio;
-
- if (audio != null)
- {
- if (!albums.Any(a => string.Equals(a, audio.Album, StringComparison.OrdinalIgnoreCase)))
- {
- return false;
- }
- }
-
- var album = i as MusicAlbum;
-
- if (album != null)
- {
- if (!albums.Any(a => string.Equals(a, album.Name, StringComparison.OrdinalIgnoreCase)))
- {
- return false;
- }
- }
-
- var musicVideo = i as MusicVideo;
-
- if (musicVideo != null)
- {
- if (!albums.Any(a => string.Equals(a, musicVideo.Album, StringComparison.OrdinalIgnoreCase)))
- {
- return false;
- }
- }
-
- return false;
- }
-
return true;
}