jellyfin-server/MediaBrowser.TV/Resolvers/SeasonResolver.cs
LukePulverenti Luke Pulverenti luke pulverenti 2454b72c93 Comments and cleanup. ALso updated ffmpeg + ffprobe
2012-08-23 14:35:44 -04:00

35 lines
1.1 KiB
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.Parent is Series && args.IsDirectory)
{
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
if (args.ContainsFolder("metadata"))
{
season.MetadataFiles = Directory.GetFiles(Path.Combine(args.Path, "metadata"), "*", SearchOption.TopDirectoryOnly);
}
else
{
season.MetadataFiles = new string[] { };
}
return season;
}
return null;
}
}
}