diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-06 22:10:38 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-06 22:10:38 -0400 |
| commit | 56c0d491f4c05a2c0c4f21c20e3530c039b33148 (patch) | |
| tree | 54274881bca0834c2ab518c51bc65160fc320db1 | |
| parent | e8a88b41abcccc88e88007ba2deaa315a71e9b62 (diff) | |
fixes #769 - Artists pages don't include music videos
4 files changed, 29 insertions, 9 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index fe45cd39e..612f73191 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1368,7 +1368,7 @@ namespace MediaBrowser.Api.Playback mediaUrl = streamInfo.Url; } - if (!string.IsNullOrEmpty(path) && File.Exists(path)) + if (!string.IsNullOrEmpty(path)) { state.MediaPath = path; state.IsRemote = false; @@ -1381,7 +1381,7 @@ namespace MediaBrowser.Api.Playback state.RunTimeTicks = recording.RunTimeTicks; - if (recording.RecordingInfo.Status == RecordingStatus.InProgress && !state.IsRemote) + if (recording.RecordingInfo.Status == RecordingStatus.InProgress) { await Task.Delay(1000, cancellationToken).ConfigureAwait(false); } @@ -1404,7 +1404,7 @@ namespace MediaBrowser.Api.Playback state.LiveTvStreamId = streamInfo.Id; - if (!string.IsNullOrEmpty(streamInfo.Path) && File.Exists(streamInfo.Path)) + if (!string.IsNullOrEmpty(streamInfo.Path)) { state.MediaPath = streamInfo.Path; state.IsRemote = false; diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index 9972ac3ef..5ca0d75ac 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -15,14 +15,12 @@ namespace MediaBrowser.Api.UserLibrary /// <summary> /// Class GetArtists /// </summary> - [Route("/Artists", "GET")] - [Api(Description = "Gets all artists from a given item, folder, or the entire library")] + [Route("/Artists", "GET", Summary = "Gets all artists from a given item, folder, or the entire library")] public class GetArtists : GetItemsByName { } - [Route("/Artists/{Name}", "GET")] - [Api(Description = "Gets an artist, by name")] + [Route("/Artists/{Name}", "GET", Summary = "Gets an artist, by name")] public class GetArtist : IReturn<BaseItemDto> { /// <summary> @@ -112,7 +110,7 @@ namespace MediaBrowser.Api.UserLibrary protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items) { return items - .OfType<Audio>() + .OfType<IHasArtist>() .SelectMany(i => i.AllArtists) .Distinct(StringComparer.OrdinalIgnoreCase) .Select(name => diff --git a/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs b/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs index 7448e44f0..08eaf903e 100644 --- a/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/IHasAlbumArtist.cs @@ -1,4 +1,5 @@ - +using System.Collections.Generic; + namespace MediaBrowser.Controller.Entities.Audio { public interface IHasAlbumArtist @@ -9,5 +10,7 @@ namespace MediaBrowser.Controller.Entities.Audio public interface IHasArtist { bool HasArtist(string name); + + List<string> AllArtists { get; } } } diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs index c3c4b89ba..554914ec6 100644 --- a/MediaBrowser.Controller/Entities/MusicVideo.cs +++ b/MediaBrowser.Controller/Entities/MusicVideo.cs @@ -3,7 +3,9 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Entities; using System; +using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; namespace MediaBrowser.Controller.Entities { @@ -33,6 +35,23 @@ namespace MediaBrowser.Controller.Entities /// <value>The revenue.</value> public double? Revenue { get; set; } + [IgnoreDataMember] + public List<string> AllArtists + { + get + { + var list = new List<string>(); + + if (!string.IsNullOrEmpty(Artist)) + { + list.Add(Artist); + } + + return list; + + } + } + /// <summary> /// Determines whether the specified name has artist. /// </summary> |
