mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-17 10:58:58 -07:00
34 lines
980 B
C#
34 lines
980 B
C#
using System.ComponentModel.Composition;
|
|
using System.IO;
|
|
using MediaBrowser.Controller.Events;
|
|
using MediaBrowser.Controller.Resolvers;
|
|
using MediaBrowser.TV.Entities;
|
|
|
|
namespace MediaBrowser.TV.Resolvers
|
|
{
|
|
[Export(typeof(IBaseItemResolver))]
|
|
public class SeasonResolver : BaseFolderResolver<Season>
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|