diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-29 14:51:30 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-29 14:51:30 -0500 |
| commit | 999ad78a0d899c4b9a441933ff68843b0ae3e0a9 (patch) | |
| tree | 63d2bbc8504595b1c47e36f5e3c16e3fc51b671e /MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs | |
| parent | aaac7e4208a1098bccdc5a7d4c939ef30a3a1e9f (diff) | |
rework configurations
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs | 50 |
1 files changed, 45 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index f6d33079b..35519b932 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -1,10 +1,9 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; -using MediaBrowser.Naming.Audio; using MediaBrowser.Naming.Common; -using MediaBrowser.Naming.Video; using System; +using System.IO; namespace MediaBrowser.Server.Implementations.Library.Resolvers { @@ -29,7 +28,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers /// <returns>`0.</returns> protected override T Resolve(ItemResolveArgs args) { - return ResolveVideo<T>(args); + return ResolveVideo<T>(args, true); } /// <summary> @@ -37,8 +36,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers /// </summary> /// <typeparam name="TVideoType">The type of the T video type.</typeparam> /// <param name="args">The args.</param> + /// <param name="parseName">if set to <c>true</c> [parse name].</param> /// <returns>``0.</returns> - protected TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args) + protected TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args, bool parseName) where TVideoType : Video, new() { // If the path is a file check for a matching extensions @@ -69,10 +69,18 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers IsInMixedFolder = true, IsPlaceHolder = videoInfo.IsStub, IsShortcut = isShortcut, - Name = videoInfo.Name, ProductionYear = videoInfo.Year }; + if (parseName) + { + video.Name = videoInfo.Name; + } + else + { + video.Name = Path.GetFileNameWithoutExtension(path); + } + if (videoInfo.IsStub) { if (string.Equals(videoInfo.StubType, "dvd", StringComparison.OrdinalIgnoreCase)) @@ -89,6 +97,38 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers } } + if (videoInfo.Is3D) + { + if (string.Equals(videoInfo.Format3D, "fsbs", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.FullSideBySide; + } + else if (string.Equals(videoInfo.Format3D, "ftab", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.FullTopAndBottom; + } + else if (string.Equals(videoInfo.Format3D, "hsbs", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.HalfSideBySide; + } + else if (string.Equals(videoInfo.Format3D, "htab", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.HalfTopAndBottom; + } + else if (string.Equals(videoInfo.Format3D, "sbs", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.HalfSideBySide; + } + else if (string.Equals(videoInfo.Format3D, "sbs3d", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.HalfSideBySide; + } + else if (string.Equals(videoInfo.Format3D, "tab", StringComparison.OrdinalIgnoreCase)) + { + video.Video3DFormat = Video3DFormat.HalfTopAndBottom; + } + } + return video; } } |
