diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-08 08:19:11 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-08 08:19:11 -0400 |
| commit | 280a53868a0033463a31dc3006b36ce209663b69 (patch) | |
| tree | 69aa2c3ca9c8d9d08288bcf8caccc1bb74cac613 | |
| parent | 1b7c1e0c53c429f4d9db7c22ac1a3869038db19a (diff) | |
fix wrong music videos showing on album page
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/ItemsService.cs | 37 | ||||
| -rw-r--r-- | MediaBrowser.Providers/TV/RemoteSeriesProvider.cs | 2 |
2 files changed, 37 insertions, 2 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 6ff480e3f..5e0bfca97 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -82,9 +82,12 @@ namespace MediaBrowser.Api.UserLibrary /// Gets or sets the studios. /// </summary> /// <value>The studios.</value> - [ApiMember(Name = "Artists", Description = "Optional. If specified, results will be filtered based on studio. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Artists", Description = "Optional. If specified, results will be filtered based on artist. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Artists { get; set; } + [ApiMember(Name = "Albums", Description = "Optional. If specified, results will be filtered based on album. This allows multiple, pipe delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + public string Albums { get; set; } + /// <summary> /// Limit results to items containing specific years /// </summary> @@ -452,6 +455,38 @@ namespace MediaBrowser.Api.UserLibrary }); } + // Albums + if (!string.IsNullOrEmpty(request.Albums)) + { + var albums = request.Albums.Split('|'); + + items = items.Where(i => + { + var audio = i as Audio; + + if (audio != null) + { + return albums.Any(a => string.Equals(a, audio.Album, StringComparison.OrdinalIgnoreCase)); + } + + var album = i as MusicAlbum; + + if (album != null) + { + return albums.Any(a => string.Equals(a, album.Name, StringComparison.OrdinalIgnoreCase)); + } + + var musicVideo = i as MusicVideo; + + if (musicVideo != null) + { + return albums.Any(a => string.Equals(a, musicVideo.Album, StringComparison.OrdinalIgnoreCase)); + } + + return false; + }); + } + if (!string.IsNullOrEmpty(request.AdjacentTo)) { var item = DtoBuilder.GetItemByClientId(request.AdjacentTo, _userManager, _libraryManager); diff --git a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs index 1905bbddb..307094d19 100644 --- a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs @@ -495,7 +495,7 @@ namespace MediaBrowser.Providers.TV foreach (XmlNode node in nodes) { var n = node.SelectSingleNode("./SeriesName"); - if (n != null && GetComparableName(n.InnerText) == comparableName) + if (n != null && string.Equals(GetComparableName(n.InnerText), comparableName, StringComparison.OrdinalIgnoreCase)) { n = node.SelectSingleNode("./seriesid"); if (n != null) |
