2012-07-26 04:33:11 +02:00
|
|
|
|
using System.ComponentModel.Composition;
|
2012-07-12 08:55:27 +02:00
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Controller.Events;
|
|
|
|
|
using MediaBrowser.Controller.Resolvers;
|
|
|
|
|
using MediaBrowser.TV.Entities;
|
2012-08-18 21:38:27 +02:00
|
|
|
|
using MediaBrowser.TV.Metadata;
|
2012-07-12 08:55:27 +02:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.TV.Resolvers
|
|
|
|
|
{
|
2012-07-26 04:33:11 +02:00
|
|
|
|
[Export(typeof(IBaseItemResolver))]
|
|
|
|
|
public class SeasonResolver : BaseFolderResolver<Season>
|
2012-07-12 08:55:27 +02: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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|