fixes #296 - Prevent non-movie videos from appearing in Movies view

This commit is contained in:
Luke Pulverenti
2013-05-27 21:59:26 -04:00
parent 1f1eab209a
commit 657097ee15
20 changed files with 136 additions and 35 deletions

View File

@@ -19,6 +19,18 @@ namespace MediaBrowser.Controller.Resolvers
/// <param name="args">The args.</param>
/// <returns>`0.</returns>
protected override T Resolve(ItemResolveArgs args)
{
return ResolveVideo<T>(args);
}
/// <summary>
/// Resolves the video.
/// </summary>
/// <typeparam name="TVideoType">The type of the T video type.</typeparam>
/// <param name="args">The args.</param>
/// <returns>``0.</returns>
protected TVideoType ResolveVideo<TVideoType>(ItemResolveArgs args)
where TVideoType : Video, new()
{
// If the path is a file check for a matching extensions
if (!args.IsDirectory)
@@ -30,7 +42,7 @@ namespace MediaBrowser.Controller.Resolvers
var type = string.Equals(extension, ".iso", StringComparison.OrdinalIgnoreCase) || string.Equals(extension, ".img", StringComparison.OrdinalIgnoreCase) ?
VideoType.Iso : VideoType.VideoFile;
return new T
return new TVideoType
{
VideoType = type,
Path = args.Path