fixes #697 - Support xbmc offline discs

This commit is contained in:
Luke Pulverenti 2014-03-03 00:11:03 -05:00
parent 2db452f68f
commit 6efb78b8b2
27 changed files with 154 additions and 45 deletions

View file

@ -35,7 +35,9 @@ namespace MediaBrowser.Controller.Resolvers
// If the path is a file check for a matching extensions
if (!args.IsDirectory)
{
if (EntityResolutionHelper.IsVideoFile(args.Path))
var isPlaceHolder = EntityResolutionHelper.IsVideoPlaceHolder(args.Path);
if (EntityResolutionHelper.IsVideoFile(args.Path) || isPlaceHolder)
{
var extension = Path.GetExtension(args.Path);
@ -46,7 +48,8 @@ namespace MediaBrowser.Controller.Resolvers
{
VideoType = type,
Path = args.Path,
IsInMixedFolder = true
IsInMixedFolder = true,
IsPlaceHolder = isPlaceHolder
};
}
}

View file

@ -139,6 +139,24 @@ namespace MediaBrowser.Controller.Resolvers
return VideoFileExtensionsDictionary.ContainsKey(extension);
}
/// <summary>
/// Determines whether [is place holder] [the specified path].
/// </summary>
/// <param name="path">The path.</param>
/// <returns><c>true</c> if [is place holder] [the specified path]; otherwise, <c>false</c>.</returns>
/// <exception cref="System.ArgumentNullException">path</exception>
public static bool IsVideoPlaceHolder(string path)
{
if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
}
var extension = Path.GetExtension(path);
return string.Equals(extension, ".disc", StringComparison.OrdinalIgnoreCase);
}
/// <summary>
/// Ensures DateCreated and DateModified have values
/// </summary>