From 07e230c2eb9524c7c5e8a7fe0a021df3801d40b0 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 25 Jun 2013 14:10:39 -0400 Subject: Added Video3DFormat property --- MediaBrowser.Controller/Dto/DtoBuilder.cs | 2 +- MediaBrowser.Controller/Entities/Video.cs | 8 +++++++- .../Resolvers/BaseVideoResolver.cs | 21 ++++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.cs index 2bd338431..77559958a 100644 --- a/MediaBrowser.Controller/Dto/DtoBuilder.cs +++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs @@ -449,7 +449,7 @@ namespace MediaBrowser.Controller.Dto if (video != null) { dto.VideoType = video.VideoType; - dto.VideoFormat = video.VideoFormat; + dto.Video3DFormat = video.Video3DFormat; dto.IsoType = video.IsoType; dto.PartCount = video.AdditionalPartIds.Count + 1; diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 9df29cdfc..1fef52fa2 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -39,6 +39,12 @@ namespace MediaBrowser.Controller.Entities /// The type of the iso. public IsoType? IsoType { get; set; } + /// + /// Gets or sets the video3 D format. + /// + /// The video3 D format. + public Video3DFormat? Video3DFormat { get; set; } + /// /// Gets or sets the format of the video. /// @@ -101,7 +107,7 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public bool Is3D { - get { return VideoFormat > 0; } + get { return Video3DFormat.HasValue; } } /// diff --git a/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs index 3decbc0a4..0ed02c10f 100644 --- a/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs +++ b/MediaBrowser.Controller/Resolvers/BaseVideoResolver.cs @@ -62,7 +62,26 @@ namespace MediaBrowser.Controller.Resolvers { base.SetInitialItemValues(item, args); - item.VideoFormat = item.Path.IndexOf("[3d]", StringComparison.OrdinalIgnoreCase) != -1 ? VideoFormat.Digital3D : item.Path.IndexOf("[sbs3d]", StringComparison.OrdinalIgnoreCase) != -1 ? VideoFormat.Sbs3D : VideoFormat.Standard; + if (item.Path.IndexOf("[3d]", StringComparison.OrdinalIgnoreCase) != -1 || item.Path.IndexOf("[sbs3d]", StringComparison.OrdinalIgnoreCase) != -1) + { + item.Video3DFormat = Video3DFormat.HalfSideBySide; + } + else if (item.Path.IndexOf("[hsbs]", StringComparison.OrdinalIgnoreCase) != -1) + { + item.Video3DFormat = Video3DFormat.HalfSideBySide; + } + else if (item.Path.IndexOf("[fsbs]", StringComparison.OrdinalIgnoreCase) != -1) + { + item.Video3DFormat = Video3DFormat.FullSideBySide; + } + else if (item.Path.IndexOf("[ftab]", StringComparison.OrdinalIgnoreCase) != -1) + { + item.Video3DFormat = Video3DFormat.FullTopAndBottom; + } + else if (item.Path.IndexOf("[htab]", StringComparison.OrdinalIgnoreCase) != -1) + { + item.Video3DFormat = Video3DFormat.HalfTopAndBottom; + } } } } -- cgit v1.2.3