2012-07-26 02:33:11 +00:00
|
|
|
|
using System.ComponentModel.Composition;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Controller.Events;
|
|
|
|
|
using MediaBrowser.Controller.Resolvers;
|
|
|
|
|
using MediaBrowser.TV.Entities;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.TV.Resolvers
|
|
|
|
|
{
|
2012-07-26 02:33:11 +00:00
|
|
|
|
[Export(typeof(IBaseItemResolver))]
|
|
|
|
|
public class SeasonResolver : BaseFolderResolver<Season>
|
2012-07-12 06:55:27 +00:00
|
|
|
|
{
|
|
|
|
|
protected override Season Resolve(ItemResolveEventArgs args)
|
|
|
|
|
{
|
2012-08-21 14:42:40 +00:00
|
|
|
|
if (args.Parent is Series && args.IsDirectory)
|
2012-07-12 06:55:27 +00:00
|
|
|
|
{
|
|
|
|
|
Season season = new Season();
|
|
|
|
|
|
|
|
|
|
if (args.ContainsFolder("metadata"))
|
|
|
|
|
{
|
|
|
|
|
season.MetadataFiles = Directory.GetFiles(Path.Combine(args.Path, "metadata"), "*", SearchOption.TopDirectoryOnly);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
season.MetadataFiles = new string[] { };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return season;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|