diff options
Diffstat (limited to 'MediaBrowser.Model/Entities')
| -rw-r--r-- | MediaBrowser.Model/Entities/ChapterInfo.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/DisplayPreferences.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/ImageType.cs | 24 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/MediaStream.cs | 125 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/MediaUrl.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/VideoSize.cs | 8 |
6 files changed, 133 insertions, 38 deletions
diff --git a/MediaBrowser.Model/Entities/ChapterInfo.cs b/MediaBrowser.Model/Entities/ChapterInfo.cs index 9da7a9caa..7e5700965 100644 --- a/MediaBrowser.Model/Entities/ChapterInfo.cs +++ b/MediaBrowser.Model/Entities/ChapterInfo.cs @@ -1,4 +1,5 @@ - +using System; + namespace MediaBrowser.Model.Entities { /// <summary> @@ -23,5 +24,6 @@ namespace MediaBrowser.Model.Entities /// </summary> /// <value>The image path.</value> public string ImagePath { get; set; } + public DateTime ImageDateModified { get; set; } } } diff --git a/MediaBrowser.Model/Entities/DisplayPreferences.cs b/MediaBrowser.Model/Entities/DisplayPreferences.cs index 6399670c9..0ba8eaa4f 100644 --- a/MediaBrowser.Model/Entities/DisplayPreferences.cs +++ b/MediaBrowser.Model/Entities/DisplayPreferences.cs @@ -1,22 +1,15 @@ using MediaBrowser.Model.Drawing; using System; using System.Collections.Generic; -using System.ComponentModel; -using MediaBrowser.Model.Extensions; namespace MediaBrowser.Model.Entities { /// <summary> /// Defines the display preferences for any item that supports them (usually Folders) /// </summary> - public class DisplayPreferences : IHasPropertyChangedEvent + public class DisplayPreferences { /// <summary> - /// Occurs when [property changed]. - /// </summary> - public event PropertyChangedEventHandler PropertyChanged; - - /// <summary> /// The image scale /// </summary> private const double ImageScale = .9; diff --git a/MediaBrowser.Model/Entities/ImageType.cs b/MediaBrowser.Model/Entities/ImageType.cs index 18097abb4..6e0ba717f 100644 --- a/MediaBrowser.Model/Entities/ImageType.cs +++ b/MediaBrowser.Model/Entities/ImageType.cs @@ -9,50 +9,50 @@ namespace MediaBrowser.Model.Entities /// <summary> /// The primary /// </summary> - Primary, + Primary = 0, /// <summary> /// The art /// </summary> - Art, + Art = 1, /// <summary> /// The backdrop /// </summary> - Backdrop, + Backdrop = 2, /// <summary> /// The banner /// </summary> - Banner, + Banner = 3, /// <summary> /// The logo /// </summary> - Logo, + Logo = 4, /// <summary> /// The thumb /// </summary> - Thumb, + Thumb = 5, /// <summary> /// The disc /// </summary> - Disc, + Disc = 6, /// <summary> /// The box /// </summary> - Box, + Box = 7, /// <summary> /// The screenshot /// </summary> - Screenshot, + Screenshot = 8, /// <summary> /// The menu /// </summary> - Menu, + Menu = 9, /// <summary> /// The chapter image /// </summary> - Chapter, + Chapter = 10, /// <summary> /// The box rear /// </summary> - BoxRear + BoxRear = 11 } } diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 79fa46baf..990de332e 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -1,6 +1,8 @@ -using MediaBrowser.Model.Dlna; +using System.Collections.Generic; +using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Extensions; using System.Diagnostics; +using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Model.Entities { @@ -33,13 +35,96 @@ namespace MediaBrowser.Model.Entities /// </summary> /// <value>The comment.</value> public string Comment { get; set; } - + + public string TimeBase { get; set; } + public string CodecTimeBase { get; set; } + + public string Title { get; set; } + + public string DisplayTitle + { + get + { + if (!string.IsNullOrEmpty(Title)) + { + return Title; + } + + if (Type == MediaStreamType.Audio) + { + List<string> attributes = new List<string>(); + + if (!string.IsNullOrEmpty(Language)) + { + attributes.Add(StringHelper.FirstToUpper(Language)); + } + if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca")) + { + attributes.Add(AudioCodec.GetFriendlyName(Codec)); + } + else if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc")) + { + attributes.Add(Profile); + } + + if (!string.IsNullOrEmpty(ChannelLayout)) + { + attributes.Add(ChannelLayout); + } + else if (Channels.HasValue) + { + attributes.Add(StringHelper.ToStringCultureInvariant(Channels.Value) + " ch"); + } + if (IsDefault) + { + attributes.Add("Default"); + } + + return string.Join(" ", attributes.ToArray()); + } + + if (Type == MediaStreamType.Subtitle) + { + List<string> attributes = new List<string>(); + + if (!string.IsNullOrEmpty(Language)) + { + attributes.Add(StringHelper.FirstToUpper(Language)); + } + if (IsDefault) + { + attributes.Add("Default"); + } + + if (IsForced) + { + attributes.Add("Forced"); + } + + string name = string.Join(" ", attributes.ToArray()); + + return name; + } + + if (Type == MediaStreamType.Video) + { + + } + + return null; + } + } + + public string NalLengthSize { get; set; } + /// <summary> /// Gets or sets a value indicating whether this instance is interlaced. /// </summary> /// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value> public bool IsInterlaced { get; set; } + public bool? IsAVC { get; set; } + /// <summary> /// Gets or sets the channel layout. /// </summary> @@ -197,6 +282,36 @@ namespace MediaBrowser.Model.Entities !StringHelper.EqualsIgnoreCase(codec, "sub"); } + public bool SupportsSubtitleConversionTo(string codec) + { + if (!IsTextSubtitleStream) + { + return false; + } + + // Can't convert from this + if (StringHelper.EqualsIgnoreCase(Codec, "ass")) + { + return false; + } + if (StringHelper.EqualsIgnoreCase(Codec, "ssa")) + { + return false; + } + + // Can't convert to this + if (StringHelper.EqualsIgnoreCase(codec, "ass")) + { + return false; + } + if (StringHelper.EqualsIgnoreCase(codec, "ssa")) + { + return false; + } + + return true; + } + /// <summary> /// Gets or sets a value indicating whether [supports external stream]. /// </summary> @@ -232,11 +347,5 @@ namespace MediaBrowser.Model.Entities /// </summary> /// <value><c>true</c> if this instance is anamorphic; otherwise, <c>false</c>.</value> public bool? IsAnamorphic { get; set; } - - /// <summary> - /// Gets or sets a value indicating whether this instance is cabac. - /// </summary> - /// <value><c>null</c> if [is cabac] contains no value, <c>true</c> if [is cabac]; otherwise, <c>false</c>.</value> - public bool? IsCabac { get; set; } } } diff --git a/MediaBrowser.Model/Entities/MediaUrl.cs b/MediaBrowser.Model/Entities/MediaUrl.cs index 24e3b1492..2e17bba8a 100644 --- a/MediaBrowser.Model/Entities/MediaUrl.cs +++ b/MediaBrowser.Model/Entities/MediaUrl.cs @@ -5,6 +5,5 @@ namespace MediaBrowser.Model.Entities { public string Url { get; set; } public string Name { get; set; } - public VideoSize? VideoSize { get; set; } } } diff --git a/MediaBrowser.Model/Entities/VideoSize.cs b/MediaBrowser.Model/Entities/VideoSize.cs deleted file mode 100644 index 0100f3b90..000000000 --- a/MediaBrowser.Model/Entities/VideoSize.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace MediaBrowser.Model.Entities -{ - public enum VideoSize - { - StandardDefinition, - HighDefinition - } -}
\ No newline at end of file |
