support dvd without video_ts folder

This commit is contained in:
Luke Pulverenti
2014-12-08 23:57:18 -05:00
parent 5eb44c42c5
commit 4548e6598d
28 changed files with 352 additions and 133 deletions

View File

@@ -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);
}
/// <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>
@@ -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));
}
}
}