2012-09-10 18:34:02 -07:00
|
|
|
|
using MediaBrowser.Controller.Entities.TV;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
2012-09-08 12:05:18 -07:00
|
|
|
|
using System.ComponentModel.Composition;
|
2012-07-11 23:55:27 -07:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2012-09-08 12:05:18 -07:00
|
|
|
|
namespace MediaBrowser.Controller.Resolvers.TV
|
2012-07-11 23:55:27 -07:00
|
|
|
|
{
|
2012-07-25 19:33:11 -07:00
|
|
|
|
[Export(typeof(IBaseItemResolver))]
|
|
|
|
|
public class SeasonResolver : BaseFolderResolver<Season>
|
2012-07-11 23:55:27 -07:00
|
|
|
|
{
|
|
|
|
|
protected override Season Resolve(ItemResolveEventArgs args)
|
|
|
|
|
{
|
2012-09-19 07:22:53 -07:00
|
|
|
|
if (args.Parent is Series && args.IsDirectory)
|
2012-07-11 23:55:27 -07:00
|
|
|
|
{
|
2012-09-11 12:37:14 -07:00
|
|
|
|
var season = new Season { };
|
2012-07-11 23:55:27 -07:00
|
|
|
|
|
2012-08-27 05:18:59 -07:00
|
|
|
|
season.IndexNumber = TVUtils.GetSeasonNumberFromPath(args.Path);
|
|
|
|
|
|
2012-07-11 23:55:27 -07:00
|
|
|
|
return season;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|