aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/UserLibrary/ArtistsService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/UserLibrary/ArtistsService.cs')
-rw-r--r--MediaBrowser.Api/UserLibrary/ArtistsService.cs67
1 files changed, 1 insertions, 66 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs
index 6bc8a2bea..d9db48a30 100644
--- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs
@@ -22,28 +22,6 @@ namespace MediaBrowser.Api.UserLibrary
{
}
- /// <summary>
- /// Class GetArtistsItemCounts
- /// </summary>
- [Route("/Artists/{Name}/Counts", "GET")]
- [Api(Description = "Gets item counts of library items that an artist appears in")]
- public class GetArtistsItemCounts : IReturn<ItemByNameCounts>
- {
- /// <summary>
- /// Gets or sets the user id.
- /// </summary>
- /// <value>The user id.</value>
- [ApiMember(Name = "UserId", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
- public Guid UserId { get; set; }
-
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- /// <value>The name.</value>
- [ApiMember(Name = "Name", Description = "The artist name", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")]
- public string Name { get; set; }
- }
-
[Route("/Artists/{Name}", "GET")]
[Api(Description = "Gets an artist, by name")]
public class GetArtist : IReturn<BaseItemDto>
@@ -119,49 +97,6 @@ namespace MediaBrowser.Api.UserLibrary
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
- public object Get(GetArtistsItemCounts request)
- {
- var name = DeSlugArtistName(request.Name, LibraryManager);
-
- var items = GetItems(request.UserId).Where(i =>
- {
- var song = i as Audio;
-
- if (song != null)
- {
- return song.HasArtist(name);
- }
-
- var musicVideo = i as MusicVideo;
-
- if (musicVideo != null)
- {
- return musicVideo.HasArtist(name);
- }
-
- return false;
-
- }).ToList();
-
- var counts = new ItemByNameCounts
- {
- TotalCount = items.Count,
-
- SongCount = items.OfType<Audio>().Count(),
-
- AlbumCount = items.Select(i => i.Parent).OfType<MusicAlbum>().Distinct().Count(),
-
- MusicVideoCount = items.OfType<MusicVideo>().Count(i => i.HasArtist(name))
- };
-
- return ToOptimizedResult(counts);
- }
-
- /// <summary>
- /// Gets the specified request.
- /// </summary>
- /// <param name="request">The request.</param>
- /// <returns>System.Object.</returns>
public object Get(GetArtists request)
{
var result = GetResult(request).Result;
@@ -193,7 +128,7 @@ namespace MediaBrowser.Api.UserLibrary
return list;
})
.Distinct(StringComparer.OrdinalIgnoreCase)
- .Select(name => new IbnStub<Artist>(name, () => itemsList.Where(i => i.HasArtist(name)), GetEntity));
+ .Select(name => new IbnStub<Artist>(name, GetEntity));
}
/// <summary>