From bce86c502206b016cc448afc1934101b852a1994 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 19 Nov 2013 22:15:48 -0500 Subject: pull person sort order from tvdb/tmdb data --- MediaBrowser.Controller/Entities/BaseItem.cs | 21 ++++++++++++++++----- MediaBrowser.Controller/Entities/IHasAspectRatio.cs | 14 ++++++++++++++ MediaBrowser.Controller/Entities/Person.cs | 6 ++++++ MediaBrowser.Controller/Entities/Video.cs | 8 +++++++- 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 MediaBrowser.Controller/Entities/IHasAspectRatio.cs (limited to 'MediaBrowser.Controller/Entities') diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index a6178536c..6b6719f01 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -483,6 +483,22 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public Folder Parent { get; set; } + [IgnoreDataMember] + public IEnumerable Parents + { + get + { + var parent = Parent; + + while (parent != null) + { + yield return parent; + + parent = parent.Parent; + } + } + } + /// /// When the item first debuted. For movies this could be premiere date, episodes would be first aired /// @@ -630,11 +646,6 @@ namespace MediaBrowser.Controller.Entities /// The original run time ticks. public long? OriginalRunTimeTicks { get; set; } /// - /// Gets or sets the aspect ratio. - /// - /// The aspect ratio. - public string AspectRatio { get; set; } - /// /// Gets or sets the production year. /// /// The production year. diff --git a/MediaBrowser.Controller/Entities/IHasAspectRatio.cs b/MediaBrowser.Controller/Entities/IHasAspectRatio.cs new file mode 100644 index 000000000..5aecf4eac --- /dev/null +++ b/MediaBrowser.Controller/Entities/IHasAspectRatio.cs @@ -0,0 +1,14 @@ +namespace MediaBrowser.Controller.Entities +{ + /// + /// Interface IHasAspectRatio + /// + public interface IHasAspectRatio + { + /// + /// Gets or sets the aspect ratio. + /// + /// The aspect ratio. + string AspectRatio { get; set; } + } +} diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index e5cf48ad0..17b9d7741 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -49,6 +49,12 @@ namespace MediaBrowser.Controller.Entities /// The type. public string Type { get; set; } + /// + /// Gets or sets the sort order - ascending + /// + /// The sort order. + public int? SortOrder { get; set; } + /// /// Returns a that represents this instance. /// diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index e900dd77e..6a27ed690 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Entities /// /// Class Video /// - public class Video : BaseItem, IHasMediaStreams + public class Video : BaseItem, IHasMediaStreams, IHasAspectRatio { public bool IsMultiPart { get; set; } @@ -65,6 +65,12 @@ namespace MediaBrowser.Controller.Entities return GetPlayableStreamFiles(Path); } + /// + /// Gets or sets the aspect ratio. + /// + /// The aspect ratio. + public string AspectRatio { get; set; } + /// /// Should be overridden to return the proper folder where metadata lives /// -- cgit v1.2.3