Browse Source

add more data to item counts

Luke Pulverenti 12 years ago
parent
commit
e24d7676fe
2 changed files with 31 additions and 1 deletions
  1. 5 1
      MediaBrowser.Api/LibraryService.cs
  2. 26 0
      MediaBrowser.Model/Dto/ItemCounts.cs

+ 5 - 1
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);

+ 26 - 0
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>();
+        }
     }
 }