jellyfin/MediaBrowser.TV/Resolvers/SeasonResolver.cs

35 lines
1.1 KiB
C#
Raw Normal View History

using System.ComponentModel.Composition;
2012-07-11 23:55:27 -07:00
using System.IO;
using MediaBrowser.Controller.Library;
2012-07-11 23:55:27 -07:00
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.TV.Entities;
namespace MediaBrowser.TV.Resolvers
{
[Export(typeof(IBaseItemResolver))]
public class SeasonResolver : BaseFolderResolver<Season>
2012-07-11 23:55:27 -07:00
{
protected override Season Resolve(ItemResolveEventArgs args)
{
2012-08-21 07:42:40 -07:00
if (args.Parent is Series && args.IsDirectory)
2012-07-11 23:55:27 -07:00
{
Season season = new Season();
// Gather these now so that the episode provider classes can utilize them instead of having to make their own file system calls
2012-07-11 23:55:27 -07:00
if (args.ContainsFolder("metadata"))
{
season.MetadataFiles = Directory.GetFiles(Path.Combine(args.Path, "metadata"), "*", SearchOption.TopDirectoryOnly);
}
else
{
season.MetadataFiles = new string[] { };
}
return season;
}
return null;
}
}
}