From 80b3ad7bd20329e6a5bbf6eeb76af62c87434a7c Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 19 Jul 2012 22:22:44 -0400 Subject: Moved the http server to it's own assembly. added comments and made other minor re-organizations. --- MediaBrowser.Model/Entities/ApiBaseItem.cs | 39 +++++++++++++++ MediaBrowser.Model/Entities/BaseItem.cs | 78 +++++++++++++++--------------- MediaBrowser.Model/Entities/Folder.cs | 44 ++++++++--------- 3 files changed, 98 insertions(+), 63 deletions(-) create mode 100644 MediaBrowser.Model/Entities/ApiBaseItem.cs (limited to 'MediaBrowser.Model/Entities') diff --git a/MediaBrowser.Model/Entities/ApiBaseItem.cs b/MediaBrowser.Model/Entities/ApiBaseItem.cs new file mode 100644 index 0000000000..bdab9239a1 --- /dev/null +++ b/MediaBrowser.Model/Entities/ApiBaseItem.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using MediaBrowser.Model.Users; + +namespace MediaBrowser.Model.Entities +{ + /// + /// This is a concrete class that the UI can use to deserialize + /// It is flat in the sense that it will be used regardless of the type of BaseItem involved + /// + public class ApiBaseItem : BaseItem + { + } + + /// + /// This is the full return object when requesting an Item + /// + public class ApiBaseItemWrapper + where T : BaseItem + { + public T Item { get; set; } + + public UserItemData UserItemData { get; set; } + + public IEnumerable> Children { get; set; } + + [IgnoreDataMember] + public Type ItemType { get; set; } + + public string Type + { + get + { + return ItemType.Name; + } + } + } +} diff --git a/MediaBrowser.Model/Entities/BaseItem.cs b/MediaBrowser.Model/Entities/BaseItem.cs index 165328ac7b..46f859c9dc 100644 --- a/MediaBrowser.Model/Entities/BaseItem.cs +++ b/MediaBrowser.Model/Entities/BaseItem.cs @@ -6,70 +6,70 @@ namespace MediaBrowser.Model.Entities { public abstract class BaseItem { - public virtual string Name { get; set; } - public virtual string SortName { get; set; } + public string Name { get; set; } + public string SortName { get; set; } - public virtual Guid Id { get; set; } + public Guid Id { get; set; } - public virtual DateTime DateCreated { get; set; } + public DateTime DateCreated { get; set; } - public virtual DateTime DateModified { get; set; } + public DateTime DateModified { get; set; } - public virtual string Path { get; set; } + /// + /// When the item first debuted. For movies this could be premiere date, episodes would be first aired + /// + public DateTime? PremiereDate { get; set; } + + public string Path { get; set; } [IgnoreDataMember] public Folder Parent { get; set; } - public virtual string PrimaryImagePath { get; set; } - public virtual string LogoImagePath { get; set; } - public virtual string ArtImagePath { get; set; } - public virtual string ThumbnailImagePath { get; set; } - public virtual string BannerImagePath { get; set; } + public string PrimaryImagePath { get; set; } + public string LogoImagePath { get; set; } + public string ArtImagePath { get; set; } + public string ThumbnailImagePath { get; set; } + public string BannerImagePath { get; set; } - public virtual IEnumerable BackdropImagePaths { get; set; } + public IEnumerable BackdropImagePaths { get; set; } - public virtual string OfficialRating { get; set; } + public string OfficialRating { get; set; } - public virtual string CustomRating { get; set; } - public virtual string CustomPin { get; set; } + public string CustomRating { get; set; } + public string CustomPin { get; set; } - public virtual string Overview { get; set; } - public virtual string Tagline { get; set; } + public string Overview { get; set; } + public string Tagline { get; set; } [IgnoreDataMember] - public virtual IEnumerable People { get; set; } + public IEnumerable People { get; set; } - public virtual IEnumerable Studios { get; set; } + public IEnumerable Studios { get; set; } - public virtual IEnumerable Genres { get; set; } + public IEnumerable Genres { get; set; } - public virtual string DisplayMediaType { get; set; } + public string DisplayMediaType { get; set; } - public virtual float? UserRating { get; set; } - public virtual TimeSpan? RunTime { get; set; } + public float? UserRating { get; set; } + public TimeSpan? RunTime { get; set; } - public virtual string AspectRatio { get; set; } - public virtual int? ProductionYear { get; set; } + public string AspectRatio { get; set; } + public int? ProductionYear { get; set; } + + /// + /// If the item is part of a series, this is it's number in the series. + /// This could be episode number, album track number, etc. + /// + public int? IndexNumber { get; set; } [IgnoreDataMember] - public virtual IEnumerable