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;
|
2012-08-18 19:38:27 +00:00
|
|
|
|
using MediaBrowser.TV.Metadata;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
if (args.IsFolder && args.Parent is Series)
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|