Moved the http server to it's own assembly. added comments and made other minor re-organizations.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-07-19 22:22:44 -04:00
parent 6fbd5cf464
commit 80b3ad7bd2
67 changed files with 806 additions and 964 deletions

View File

@@ -1,20 +1,26 @@
using System.IO;
using System.Collections.Generic;
using System.IO;
using MediaBrowser.Controller.Events;
using MediaBrowser.Model.Entities;
using System.Linq;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Resolvers
{
/// <summary>
/// Resolves a Path into a Video
/// </summary>
public class VideoResolver : BaseVideoResolver<Video>
{
}
/// <summary>
/// Resolves a Path into a Video or Video subclass
/// </summary>
public abstract class BaseVideoResolver<T> : BaseItemResolver<T>
where T : Video, new()
{
protected override T Resolve(ItemResolveEventArgs args)
{
// If the path is a file check for a matching extensions
if (!args.IsFolder)
{
if (IsVideoFile(args.Path))
@@ -29,6 +35,7 @@ namespace MediaBrowser.Controller.Resolvers
else
{
// If the path is a folder, check if it's bluray or dvd
T item = ResolveFromFolderName(args.Path);
if (item != null)
@@ -36,6 +43,7 @@ namespace MediaBrowser.Controller.Resolvers
return item;
}
// Also check the subfolders for bluray or dvd
foreach (KeyValuePair<string, FileAttributes> folder in args.FileSystemChildren)
{
if (!folder.Value.HasFlag(FileAttributes.Directory))