aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-02 10:08:30 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-02 10:08:30 -0400
commite24d7676fed0a891ec3280e3f7103a0712cc60b2 (patch)
tree9ff53b647e1776c4f4415c99ee072f15f5063f3a
parent26ccfa9b0f4128270cb4afee597c206e9d868904 (diff)
add more data to item counts
-rw-r--r--MediaBrowser.Api/LibraryService.cs6
-rw-r--r--MediaBrowser.Model/Dto/ItemCounts.cs26
2 files changed, 31 insertions, 1 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs
index c885a3981..0f15124a5 100644
--- a/MediaBrowser.Api/LibraryService.cs
+++ b/MediaBrowser.Api/LibraryService.cs
@@ -320,13 +320,17 @@ namespace MediaBrowser.Api
AlbumCount = items.OfType<MusicAlbum>().Count(),
EpisodeCount = items.OfType<Episode>().Count(),
GameCount = items.OfType<Game>().Count(),
+ GameSystemCount = items.OfType<GameSystem>().Count(),
MovieCount = items.OfType<Movie>().Count(),
SeriesCount = items.OfType<Series>().Count(),
SongCount = items.OfType<Audio>().Count(),
TrailerCount = items.OfType<Trailer>().Count(),
MusicVideoCount = items.OfType<MusicVideo>().Count(),
AdultVideoCount = items.OfType<AdultVideo>().Count(),
- BoxSetCount = items.OfType<BoxSet>().Count()
+ BoxSetCount = items.OfType<BoxSet>().Count(),
+ BookCount = items.OfType<Book>().Count(),
+
+ UniqueTypes = items.Select(i => i.GetType().Name).Distinct().ToList()
};
return ToOptimizedResult(counts);
diff --git a/MediaBrowser.Model/Dto/ItemCounts.cs b/MediaBrowser.Model/Dto/ItemCounts.cs
index f3295b295..819a5ff4f 100644
--- a/MediaBrowser.Model/Dto/ItemCounts.cs
+++ b/MediaBrowser.Model/Dto/ItemCounts.cs
@@ -1,4 +1,6 @@

+using System.Collections.Generic;
+
namespace MediaBrowser.Model.Dto
{
/// <summary>
@@ -28,6 +30,11 @@ namespace MediaBrowser.Model.Dto
/// <value>The game count.</value>
public int GameCount { get; set; }
/// <summary>
+ /// Gets or sets the game system count.
+ /// </summary>
+ /// <value>The game system count.</value>
+ public int GameSystemCount { get; set; }
+ /// <summary>
/// Gets or sets the trailer count.
/// </summary>
/// <value>The trailer count.</value>
@@ -47,6 +54,25 @@ namespace MediaBrowser.Model.Dto
/// </summary>
/// <value>The music video count.</value>
public int MusicVideoCount { get; set; }
+ /// <summary>
+ /// Gets or sets the box set count.
+ /// </summary>
+ /// <value>The box set count.</value>
public int BoxSetCount { get; set; }
+ /// <summary>
+ /// Gets or sets the book count.
+ /// </summary>
+ /// <value>The book count.</value>
+ public int BookCount { get; set; }
+ /// <summary>
+ /// Gets or sets the unique types.
+ /// </summary>
+ /// <value>The unique types.</value>
+ public List<string> UniqueTypes { get; set; }
+
+ public ItemCounts()
+ {
+ UniqueTypes = new List<string>();
+ }
}
}