Browse Source

Made BaseJsonHandler strongly typed. Moved DTO entities to their own DTO namespace in Model.

LukePulverenti Luke Pulverenti luke pulverenti 13 years ago
parent
commit
5c094afd7e

+ 3 - 2
MediaBrowser.Api/ApiService.cs

@@ -4,6 +4,7 @@ using System.Linq;
 using System.Reflection;
 using System.Reflection;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api
 namespace MediaBrowser.Api
@@ -23,9 +24,9 @@ namespace MediaBrowser.Api
         /// <summary>
         /// <summary>
         /// Takes a BaseItem and returns the actual object that will be serialized by the api
         /// Takes a BaseItem and returns the actual object that will be serialized by the api
         /// </summary>
         /// </summary>
-        public static ApiBaseItemWrapper<BaseItem> GetSerializationObject(BaseItem item, bool includeChildren, Guid userId)
+        public static BaseItemWrapper<BaseItem> GetSerializationObject(BaseItem item, bool includeChildren, Guid userId)
         {
         {
-            ApiBaseItemWrapper<BaseItem> wrapper = new ApiBaseItemWrapper<BaseItem>()
+            BaseItemWrapper<BaseItem> wrapper = new BaseItemWrapper<BaseItem>()
             {
             {
                 Item = item,
                 Item = item,
                 UserItemData = Kernel.Instance.GetUserItemData(userId, item.Id),
                 UserItemData = Kernel.Instance.GetUserItemData(userId, item.Id),

+ 4 - 2
MediaBrowser.Api/HttpHandlers/GenresHandler.cs

@@ -1,13 +1,15 @@
 using System;
 using System;
+using System.Collections.Generic;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class GenresHandler : BaseJsonHandler
+    public class GenresHandler : BaseJsonHandler<IEnumerable<CategoryInfo<Genre>>>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override IEnumerable<CategoryInfo<Genre>> GetObjectToSerialize()
         {
         {
             Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
             Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
             Guid userId = Guid.Parse(QueryString["userid"]);
             Guid userId = Guid.Parse(QueryString["userid"]);

+ 3 - 2
MediaBrowser.Api/HttpHandlers/ItemHandler.cs

@@ -1,12 +1,13 @@
 using System;
 using System;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class ItemHandler : BaseJsonHandler
+    public class ItemHandler : BaseJsonHandler<BaseItemWrapper<BaseItem>>
     {
     {
-        protected sealed override object GetObjectToSerialize()
+        protected sealed override BaseItemWrapper<BaseItem> GetObjectToSerialize()
         {
         {
             Guid userId = Guid.Parse(QueryString["userid"]);
             Guid userId = Guid.Parse(QueryString["userid"]);
 
 

+ 3 - 2
MediaBrowser.Api/HttpHandlers/ItemListHandler.cs

@@ -2,13 +2,14 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public abstract class ItemListHandler : BaseJsonHandler
+    public abstract class ItemListHandler : BaseJsonHandler<IEnumerable<BaseItemWrapper<BaseItem>>>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override IEnumerable<BaseItemWrapper<BaseItem>> GetObjectToSerialize()
         {
         {
             return ItemsToSerialize.Select(i =>
             return ItemsToSerialize.Select(i =>
             {
             {

+ 3 - 2
MediaBrowser.Api/HttpHandlers/PersonHandler.cs

@@ -1,11 +1,12 @@
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class PersonHandler : BaseJsonHandler
+    public class PersonHandler : BaseJsonHandler<Person>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override Person GetObjectToSerialize()
         {
         {
             return Kernel.Instance.ItemController.GetPerson(QueryString["name"]);
             return Kernel.Instance.ItemController.GetPerson(QueryString["name"]);
         }
         }

+ 3 - 2
MediaBrowser.Api/HttpHandlers/PluginConfigurationHandler.cs

@@ -2,12 +2,13 @@
 using System.Linq;
 using System.Linq;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.Plugins;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class PluginConfigurationHandler : BaseJsonHandler
+    public class PluginConfigurationHandler : BaseJsonHandler<BasePluginConfiguration>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override BasePluginConfiguration GetObjectToSerialize()
         {
         {
             string pluginName = QueryString["name"];
             string pluginName = QueryString["name"];
 
 

+ 5 - 4
MediaBrowser.Api/HttpHandlers/PluginsHandler.cs

@@ -1,16 +1,17 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
-using MediaBrowser.Model.Plugins;
+using MediaBrowser.Model.DTO;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
     /// <summary>
     /// <summary>
     /// Provides information about installed plugins
     /// Provides information about installed plugins
     /// </summary>
     /// </summary>
-    public class PluginsHandler : BaseJsonHandler
+    public class PluginsHandler : BaseJsonHandler<IEnumerable<PluginInfo>>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override IEnumerable<PluginInfo> GetObjectToSerialize()
         {
         {
             var plugins = Kernel.Instance.Plugins.Select(p =>
             var plugins = Kernel.Instance.Plugins.Select(p =>
             {
             {

+ 5 - 3
MediaBrowser.Api/HttpHandlers/StudiosHandler.cs

@@ -1,17 +1,19 @@
 using System;
 using System;
+using System.Collections.Generic;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class StudiosHandler : BaseJsonHandler
+    public class StudiosHandler : BaseJsonHandler<IEnumerable<CategoryInfo<Studio>>>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override IEnumerable<CategoryInfo<Studio>> GetObjectToSerialize()
         {
         {
             Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
             Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
             Guid userId = Guid.Parse(QueryString["userid"]);
             Guid userId = Guid.Parse(QueryString["userid"]);
-
+            
             return Kernel.Instance.GetAllStudios(parent, userId);
             return Kernel.Instance.GetAllStudios(parent, userId);
         }
         }
     }
     }

+ 3 - 2
MediaBrowser.Api/HttpHandlers/UserConfigurationHandler.cs

@@ -1,12 +1,13 @@
 using System;
 using System;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.Configuration;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class UserConfigurationHandler : BaseJsonHandler
+    public class UserConfigurationHandler : BaseJsonHandler<UserConfiguration>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override UserConfiguration GetObjectToSerialize()
         {
         {
             Guid userId = Guid.Parse(QueryString["userid"]);
             Guid userId = Guid.Parse(QueryString["userid"]);
 
 

+ 5 - 3
MediaBrowser.Api/HttpHandlers/UsersHandler.cs

@@ -1,11 +1,13 @@
-using MediaBrowser.Common.Net.Handlers;
+using System.Collections.Generic;
+using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.Users;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    class UsersHandler : BaseJsonHandler
+    class UsersHandler : BaseJsonHandler<IEnumerable<User>>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override IEnumerable<User> GetObjectToSerialize()
         {
         {
             return Kernel.Instance.Users;
             return Kernel.Instance.Users;
         }
         }

+ 2 - 2
MediaBrowser.Api/HttpHandlers/VideoHandler.cs

@@ -1,10 +1,10 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using System.Drawing;
 using System.IO;
 using System.IO;
 using System.Linq;
 using System.Linq;
-using MediaBrowser.Model.Entities;
-using System.Drawing;
 using MediaBrowser.Common.Drawing;
 using MediaBrowser.Common.Drawing;
+using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {

+ 4 - 2
MediaBrowser.Api/HttpHandlers/YearsHandler.cs

@@ -1,13 +1,15 @@
 using System;
 using System;
+using System.Collections.Generic;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Common.Net.Handlers;
 using MediaBrowser.Controller;
 using MediaBrowser.Controller;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Api.HttpHandlers
 namespace MediaBrowser.Api.HttpHandlers
 {
 {
-    public class YearsHandler : BaseJsonHandler
+    public class YearsHandler : BaseJsonHandler<IEnumerable<CategoryInfo<Year>>>
     {
     {
-        protected override object GetObjectToSerialize()
+        protected override IEnumerable<CategoryInfo<Year>> GetObjectToSerialize()
         {
         {
             Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
             Folder parent = ApiService.GetItemById(QueryString["id"]) as Folder;
             Guid userId = Guid.Parse(QueryString["userid"]);
             Guid userId = Guid.Parse(QueryString["userid"]);

+ 13 - 12
MediaBrowser.ApiInteraction/ApiClient.cs

@@ -4,6 +4,7 @@ using System.IO;
 using System.Linq;
 using System.Linq;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Users;
 using MediaBrowser.Model.Users;
 
 
@@ -90,7 +91,7 @@ namespace MediaBrowser.ApiInteraction
         /// <param name="maxWidth">Use if a max width is required. Aspect ratio will be preserved.</param>
         /// <param name="maxWidth">Use if a max width is required. Aspect ratio will be preserved.</param>
         /// <param name="maxHeight">Use if a max height is required. Aspect ratio will be preserved.</param>
         /// <param name="maxHeight">Use if a max height is required. Aspect ratio will be preserved.</param>
         /// <param name="quality">Quality level, from 0-100. Currently only applies to JPG. The default value should suffice.</param>
         /// <param name="quality">Quality level, from 0-100. Currently only applies to JPG. The default value should suffice.</param>
-        public IEnumerable<string> GetBackdropImageUrls(ApiBaseItemWrapper<ApiBaseItem> itemWrapper, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? quality = null)
+        public IEnumerable<string> GetBackdropImageUrls(BaseItemWrapper<ApiBaseItem> itemWrapper, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? quality = null)
         {
         {
             Guid? backdropItemId = null;
             Guid? backdropItemId = null;
             int backdropCount = 0;
             int backdropCount = 0;
@@ -130,7 +131,7 @@ namespace MediaBrowser.ApiInteraction
         /// <param name="maxWidth">Use if a max width is required. Aspect ratio will be preserved.</param>
         /// <param name="maxWidth">Use if a max width is required. Aspect ratio will be preserved.</param>
         /// <param name="maxHeight">Use if a max height is required. Aspect ratio will be preserved.</param>
         /// <param name="maxHeight">Use if a max height is required. Aspect ratio will be preserved.</param>
         /// <param name="quality">Quality level, from 0-100. Currently only applies to JPG. The default value should suffice.</param>
         /// <param name="quality">Quality level, from 0-100. Currently only applies to JPG. The default value should suffice.</param>
-        public string GetLogoImageUrl(ApiBaseItemWrapper<ApiBaseItem> itemWrapper, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? quality = null)
+        public string GetLogoImageUrl(BaseItemWrapper<ApiBaseItem> itemWrapper, int? width = null, int? height = null, int? maxWidth = null, int? maxHeight = null, int? quality = null)
         {
         {
             Guid? logoItemId = !string.IsNullOrEmpty(itemWrapper.Item.LogoImagePath) ? itemWrapper.Item.Id : itemWrapper.ParentLogoItemId;
             Guid? logoItemId = !string.IsNullOrEmpty(itemWrapper.Item.LogoImagePath) ? itemWrapper.Item.Id : itemWrapper.ParentLogoItemId;
 
 
@@ -153,7 +154,7 @@ namespace MediaBrowser.ApiInteraction
         /// <summary>
         /// <summary>
         /// Gets a BaseItem
         /// Gets a BaseItem
         /// </summary>
         /// </summary>
-        public async Task<ApiBaseItemWrapper<ApiBaseItem>> GetItemAsync(Guid id, Guid userId)
+        public async Task<BaseItemWrapper<ApiBaseItem>> GetItemAsync(Guid id, Guid userId)
         {
         {
             string url = ApiUrl + "/item?userId=" + userId.ToString();
             string url = ApiUrl + "/item?userId=" + userId.ToString();
 
 
@@ -164,7 +165,7 @@ namespace MediaBrowser.ApiInteraction
 
 
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             {
             {
-                return JsonSerializer.DeserializeFromStream<ApiBaseItemWrapper<ApiBaseItem>>(stream);
+                return JsonSerializer.DeserializeFromStream<BaseItemWrapper<ApiBaseItem>>(stream);
             }
             }
         }
         }
 
 
@@ -210,33 +211,33 @@ namespace MediaBrowser.ApiInteraction
         /// <summary>
         /// <summary>
         /// Gets all items that contain a given Year
         /// Gets all items that contain a given Year
         /// </summary>
         /// </summary>
-        public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithYearAsync(string name, Guid userId)
+        public async Task<IEnumerable<BaseItemWrapper<ApiBaseItem>>> GetItemsWithYearAsync(string name, Guid userId)
         {
         {
             string url = ApiUrl + "/itemswithyear?userId=" + userId.ToString() + "&name=" + name;
             string url = ApiUrl + "/itemswithyear?userId=" + userId.ToString() + "&name=" + name;
 
 
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             {
             {
-                return JsonSerializer.DeserializeFromStream<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>>(stream);
+                return JsonSerializer.DeserializeFromStream<IEnumerable<BaseItemWrapper<ApiBaseItem>>>(stream);
             }
             }
         }
         }
 
 
         /// <summary>
         /// <summary>
         /// Gets all items that contain a given Genre
         /// Gets all items that contain a given Genre
         /// </summary>
         /// </summary>
-        public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithGenreAsync(string name, Guid userId)
+        public async Task<IEnumerable<BaseItemWrapper<ApiBaseItem>>> GetItemsWithGenreAsync(string name, Guid userId)
         {
         {
             string url = ApiUrl + "/itemswithgenre?userId=" + userId.ToString() + "&name=" + name;
             string url = ApiUrl + "/itemswithgenre?userId=" + userId.ToString() + "&name=" + name;
 
 
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             {
             {
-                return JsonSerializer.DeserializeFromStream<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>>(stream);
+                return JsonSerializer.DeserializeFromStream<IEnumerable<BaseItemWrapper<ApiBaseItem>>>(stream);
             }
             }
         }
         }
 
 
         /// <summary>
         /// <summary>
         /// Gets all items that contain a given Person
         /// Gets all items that contain a given Person
         /// </summary>
         /// </summary>
-        public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithPersonAsync(string name, PersonType? personType, Guid userId)
+        public async Task<IEnumerable<BaseItemWrapper<ApiBaseItem>>> GetItemsWithPersonAsync(string name, PersonType? personType, Guid userId)
         {
         {
             string url = ApiUrl + "/itemswithperson?userId=" + userId.ToString() + "&name=" + name;
             string url = ApiUrl + "/itemswithperson?userId=" + userId.ToString() + "&name=" + name;
 
 
@@ -247,7 +248,7 @@ namespace MediaBrowser.ApiInteraction
 
 
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             {
             {
-                return JsonSerializer.DeserializeFromStream<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>>(stream);
+                return JsonSerializer.DeserializeFromStream<IEnumerable<BaseItemWrapper<ApiBaseItem>>>(stream);
             }
             }
         }
         }
 
 
@@ -280,13 +281,13 @@ namespace MediaBrowser.ApiInteraction
         /// <summary>
         /// <summary>
         /// Gets all items that contain a given Studio
         /// Gets all items that contain a given Studio
         /// </summary>
         /// </summary>
-        public async Task<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>> GetItemsWithStudioAsync(string name, Guid userId)
+        public async Task<IEnumerable<BaseItemWrapper<ApiBaseItem>>> GetItemsWithStudioAsync(string name, Guid userId)
         {
         {
             string url = ApiUrl + "/itemswithstudio?userId=" + userId.ToString() + "&name=" + name;
             string url = ApiUrl + "/itemswithstudio?userId=" + userId.ToString() + "&name=" + name;
 
 
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             using (Stream stream = await HttpClient.GetStreamAsync(url))
             {
             {
-                return JsonSerializer.DeserializeFromStream<IEnumerable<ApiBaseItemWrapper<ApiBaseItem>>>(stream);
+                return JsonSerializer.DeserializeFromStream<IEnumerable<BaseItemWrapper<ApiBaseItem>>>(stream);
             }
             }
         }
         }
 
 

+ 5 - 5
MediaBrowser.Common/Net/Handlers/BaseJsonHandler.cs

@@ -4,7 +4,7 @@ using MediaBrowser.Common.Serialization;
 
 
 namespace MediaBrowser.Common.Net.Handlers
 namespace MediaBrowser.Common.Net.Handlers
 {
 {
-    public abstract class BaseJsonHandler : BaseHandler
+    public abstract class BaseJsonHandler<T> : BaseHandler
     {
     {
         public override string ContentType
         public override string ContentType
         {
         {
@@ -12,7 +12,7 @@ namespace MediaBrowser.Common.Net.Handlers
         }
         }
 
 
         private bool _ObjectToSerializeEnsured = false;
         private bool _ObjectToSerializeEnsured = false;
-        private object _ObjectToSerialize;
+        private T _ObjectToSerialize;
      
      
         private void EnsureObjectToSerialize()
         private void EnsureObjectToSerialize()
         {
         {
@@ -29,7 +29,7 @@ namespace MediaBrowser.Common.Net.Handlers
             }
             }
         }
         }
 
 
-        private object ObjectToSerialize
+        private T ObjectToSerialize
         {
         {
             get
             get
             {
             {
@@ -38,7 +38,7 @@ namespace MediaBrowser.Common.Net.Handlers
             }
             }
         }
         }
 
 
-        protected abstract object GetObjectToSerialize();
+        protected abstract T GetObjectToSerialize();
 
 
         protected override void PrepareResponse()
         protected override void PrepareResponse()
         {
         {
@@ -51,7 +51,7 @@ namespace MediaBrowser.Common.Net.Handlers
         {
         {
             return Task.Run(() =>
             return Task.Run(() =>
             {
             {
-                JsonSerializer.SerializeToStream(ObjectToSerialize, stream);
+                JsonSerializer.SerializeToStream<T>(ObjectToSerialize, stream);
             });
             });
         }
         }
     }
     }

+ 1 - 0
MediaBrowser.Controller/Kernel.cs

@@ -13,6 +13,7 @@ using MediaBrowser.Controller.IO;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Resolvers;
 using MediaBrowser.Controller.Resolvers;
 using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.DTO;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Progress;
 using MediaBrowser.Model.Progress;
 using MediaBrowser.Model.Users;
 using MediaBrowser.Model.Users;

+ 0 - 4
MediaBrowser.Controller/Xml/BaseItemXmlParser.cs

@@ -113,10 +113,6 @@ namespace MediaBrowser.Controller.Xml
                     item.CustomRating = reader.ReadString();
                     item.CustomRating = reader.ReadString();
                     break;
                     break;
 
 
-                case "CustomPin":
-                    item.CustomPin = reader.ReadString();
-                    break;
-
                 case "Genre":
                 case "Genre":
                     {
                     {
                         var genres = (item.Genres ?? new string[] { }).ToList();
                         var genres = (item.Genres ?? new string[] { }).ToList();

+ 12 - 4
MediaBrowser.Model/Entities/ApiBaseItem.cs → MediaBrowser.Model/DTO/ApiBaseItem.cs

@@ -1,8 +1,9 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
+using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Users;
 using MediaBrowser.Model.Users;
 
 
-namespace MediaBrowser.Model.Entities
+namespace MediaBrowser.Model.DTO
 {
 {
     /// <summary>
     /// <summary>
     /// This is a concrete class that the UI can use to deserialize
     /// This is a concrete class that the UI can use to deserialize
@@ -10,7 +11,7 @@ namespace MediaBrowser.Model.Entities
     /// </summary>
     /// </summary>
     public class ApiBaseItem : BaseItem
     public class ApiBaseItem : BaseItem
     {
     {
-        // TV Series
+        // Series properties
         public string Status { get; set; }
         public string Status { get; set; }
         public IEnumerable<DayOfWeek> AirDays { get; set; }
         public IEnumerable<DayOfWeek> AirDays { get; set; }
         public string AirTime { get; set; }
         public string AirTime { get; set; }
@@ -19,14 +20,14 @@ namespace MediaBrowser.Model.Entities
     /// <summary>
     /// <summary>
     /// This is the full return object when requesting an Item
     /// This is the full return object when requesting an Item
     /// </summary>
     /// </summary>
-    public class ApiBaseItemWrapper<T>
+    public class BaseItemWrapper<T>
         where T : BaseItem
         where T : BaseItem
     {
     {
         public T Item { get; set; }
         public T Item { get; set; }
 
 
         public UserItemData UserItemData { get; set; }
         public UserItemData UserItemData { get; set; }
 
 
-        public IEnumerable<ApiBaseItemWrapper<T>> Children { get; set; }
+        public IEnumerable<BaseItemWrapper<T>> Children { get; set; }
 
 
         public bool IsFolder { get; set; }
         public bool IsFolder { get; set; }
 
 
@@ -55,4 +56,11 @@ namespace MediaBrowser.Model.Entities
 
 
         public int? ParentBackdropCount { get; set; }
         public int? ParentBackdropCount { get; set; }
     }
     }
+
+    /// <summary>
+    /// This is strictly for convenience so the UI's don't have to use the verbose generic syntax of BaseItemWrapper<ApiBaseItem>
+    /// </summary>
+    public class ApiBaseItemWrapper : BaseItemWrapper<ApiBaseItem>
+    {
+    }
 }
 }

+ 1 - 1
MediaBrowser.Model/Entities/CategoryInfo.cs → MediaBrowser.Model/DTO/CategoryInfo.cs

@@ -1,5 +1,5 @@
 
 
-namespace MediaBrowser.Model.Entities
+namespace MediaBrowser.Model.DTO
 {
 {
     /// <summary>
     /// <summary>
     /// This is a stub class used by the api to get IBN types along with their item counts
     /// This is a stub class used by the api to get IBN types along with their item counts

+ 1 - 1
MediaBrowser.Model/Plugins/PluginInfo.cs → MediaBrowser.Model/DTO/PluginInfo.cs

@@ -1,6 +1,6 @@
 using System;
 using System;
 
 
-namespace MediaBrowser.Model.Plugins
+namespace MediaBrowser.Model.DTO
 {
 {
     /// <summary>
     /// <summary>
     /// This is a serializable stub class that is used by the api to provide information about installed plugins.
     /// This is a serializable stub class that is used by the api to provide information about installed plugins.

+ 2 - 2
MediaBrowser.Model/Entities/BaseItem.cs

@@ -26,9 +26,9 @@ namespace MediaBrowser.Model.Entities
         public IEnumerable<string> BackdropImagePaths { get; set; }
         public IEnumerable<string> BackdropImagePaths { get; set; }
 
 
         public string OfficialRating { get; set; }
         public string OfficialRating { get; set; }
-
+        
+        [IgnoreDataMember]
         public string CustomRating { get; set; }
         public string CustomRating { get; set; }
-        public string CustomPin { get; set; }
 
 
         public string Overview { get; set; }
         public string Overview { get; set; }
         public string Tagline { get; set; }
         public string Tagline { get; set; }

+ 3 - 3
MediaBrowser.Model/MediaBrowser.Model.csproj

@@ -33,11 +33,11 @@
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <Compile Include="Configuration\UserConfiguration.cs" />
     <Compile Include="Configuration\UserConfiguration.cs" />
-    <Compile Include="Entities\ApiBaseItem.cs" />
+    <Compile Include="DTO\ApiBaseItem.cs" />
     <Compile Include="Entities\Audio.cs" />
     <Compile Include="Entities\Audio.cs" />
     <Compile Include="Entities\BaseEntity.cs" />
     <Compile Include="Entities\BaseEntity.cs" />
     <Compile Include="Entities\BaseItem.cs" />
     <Compile Include="Entities\BaseItem.cs" />
-    <Compile Include="Entities\CategoryInfo.cs" />
+    <Compile Include="DTO\CategoryInfo.cs" />
     <Compile Include="Entities\Folder.cs" />
     <Compile Include="Entities\Folder.cs" />
     <Compile Include="Entities\Genre.cs" />
     <Compile Include="Entities\Genre.cs" />
     <Compile Include="Entities\ImageType.cs" />
     <Compile Include="Entities\ImageType.cs" />
@@ -47,7 +47,7 @@
     <Compile Include="Entities\Video.cs" />
     <Compile Include="Entities\Video.cs" />
     <Compile Include="Entities\Year.cs" />
     <Compile Include="Entities\Year.cs" />
     <Compile Include="Plugins\BasePluginConfiguration.cs" />
     <Compile Include="Plugins\BasePluginConfiguration.cs" />
-    <Compile Include="Plugins\PluginInfo.cs" />
+    <Compile Include="DTO\PluginInfo.cs" />
     <Compile Include="Progress\TaskProgress.cs" />
     <Compile Include="Progress\TaskProgress.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Users\User.cs" />
     <Compile Include="Users\User.cs" />

+ 1 - 3
MediaBrowser.Movies/Entities/BoxSet.cs

@@ -1,6 +1,4 @@
-using System;
-using System.Collections.Generic;
-using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.Entities;
 
 
 namespace MediaBrowser.Movies.Entities
 namespace MediaBrowser.Movies.Entities
 {
 {

+ 0 - 3
MediaBrowser.Movies/Entities/Movie.cs

@@ -6,9 +6,6 @@ namespace MediaBrowser.Movies.Entities
 {
 {
     public class Movie : Video
     public class Movie : Video
     {
     {
-        public string TmdbId { get; set; }
-        public string ImdbId { get; set; }
-
         [IgnoreDataMember]
         [IgnoreDataMember]
         public IEnumerable<Video> SpecialFeatures { get; set; }
         public IEnumerable<Video> SpecialFeatures { get; set; }
     }
     }

+ 3 - 3
MediaBrowser.ServerApplication/MainWindow.xaml.cs

@@ -22,15 +22,15 @@ namespace MediaBrowser.ServerApplication
             Progress<TaskProgress> progress = new Progress<TaskProgress>();
             Progress<TaskProgress> progress = new Progress<TaskProgress>();
             Common.UI.Splash splash = new Common.UI.Splash(progress);
             Common.UI.Splash splash = new Common.UI.Splash(progress);
 
 
+            splash.Show();
+            
             try
             try
             {
             {
-                splash.Show();
-
                 new Kernel().Init(progress);
                 new Kernel().Init(progress);
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
-                MessageBox.Show("There was an error launching Media Browser: " + ex.Message);
+                MessageBox.Show("There was an error launching Media Browser Server: " + ex.Message);
             }
             }
             finally
             finally
             {
             {

+ 0 - 1
MediaBrowser.TV/Entities/Episode.cs

@@ -4,6 +4,5 @@ namespace MediaBrowser.TV.Entities
 {
 {
     public class Episode : Video
     public class Episode : Video
     {
     {
-        public string SeasonNumber { get; set; }
     }
     }
 }
 }

+ 0 - 4
MediaBrowser.TV/Metadata/EpisodeXmlParser.cs

@@ -31,10 +31,6 @@ namespace MediaBrowser.TV.Metadata
                     }
                     }
                     break;
                     break;
 
 
-                case "SeasonNumber":
-                    item.SeasonNumber = reader.ReadString();
-                    break;
-
                 case "EpisodeName":
                 case "EpisodeName":
                     item.Name = reader.ReadString();
                     item.Name = reader.ReadString();
                     break;
                     break;