From 4548e6598def249d4b0fe4f4f12e2fa16d4f1e3c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 8 Dec 2014 23:57:18 -0500 Subject: support dvd without video_ts folder --- .../Library/Resolvers/BaseVideoResolver.cs | 37 ++++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs') diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs index a423ea3f1..8e2218b0a 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs @@ -94,6 +94,23 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers break; } } + else if (IsDvdFile(filename)) + { + videoInfo = parser.ResolveDirectory(args.Path); + + if (videoInfo == null) + { + return null; + } + + video = new TVideoType + { + Path = args.Path, + VideoType = VideoType.Dvd, + ProductionYear = videoInfo.Year + }; + break; + } } if (video != null) @@ -228,6 +245,16 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers return string.Equals(directoryName, "video_ts", StringComparison.OrdinalIgnoreCase); } + /// + /// Determines whether [is DVD file] [the specified name]. + /// + /// The name. + /// true if [is DVD file] [the specified name]; otherwise, false. + protected bool IsDvdFile(string name) + { + return string.Equals(name, "video_ts.ifo", StringComparison.OrdinalIgnoreCase); + } + /// /// Determines whether [is blu ray directory] [the specified directory name]. /// @@ -237,15 +264,5 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers { return string.Equals(directoryName, "bdmv", StringComparison.OrdinalIgnoreCase); } - - protected bool IsBluRayContainer(string path, IDirectoryService directoryService) - { - return directoryService.GetDirectories(path).Any(i => IsBluRayDirectory(i.Name)); - } - - protected bool IsDvdContainer(string path, IDirectoryService directoryService) - { - return directoryService.GetDirectories(path).Any(i => IsDvdDirectory(i.Name)); - } } } -- cgit v1.2.3