jellyfin-server/MediaBrowser.TV/Resolvers/SeasonResolver.cs

35 lines
1013 B
C#
Raw Normal View History

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;
using MediaBrowser.TV.Metadata;
2012-07-12 06:55:27 +00:00
namespace MediaBrowser.TV.Resolvers
{
[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;
}
}
}