jellyfin-server/MediaBrowser.TV/Resolvers/SeasonResolver.cs
LukePulverenti Luke Pulverenti luke pulverenti b50f78e5da Initial check-in
2012-07-12 02:55:27 -04:00

34 lines
925 B
C#

using System;
using System.IO;
using System.Linq;
using MediaBrowser.Controller.Events;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.TV.Entities;
namespace MediaBrowser.TV.Resolvers
{
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;
}
}
}