diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-08 23:57:18 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-12-08 23:57:18 -0500 |
| commit | 4548e6598def249d4b0fe4f4f12e2fa16d4f1e3c (patch) | |
| tree | 781febcb168647c37f027e7893adbb1b9c3dbfc1 /MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs | |
| parent | 5eb44c42c586af34dd16efc76240d0d6c8e02069 (diff) | |
support dvd without video_ts folder
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs | 37 |
1 files changed, 27 insertions, 10 deletions
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) @@ -229,6 +246,16 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers } /// <summary> + /// Determines whether [is DVD file] [the specified name]. + /// </summary> + /// <param name="name">The name.</param> + /// <returns><c>true</c> if [is DVD file] [the specified name]; otherwise, <c>false</c>.</returns> + protected bool IsDvdFile(string name) + { + return string.Equals(name, "video_ts.ifo", StringComparison.OrdinalIgnoreCase); + } + + /// <summary> /// Determines whether [is blu ray directory] [the specified directory name]. /// </summary> /// <param name="directoryName">Name of the directory.</param> @@ -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)); - } } } |
