You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Resolvers/FolderResolver.cs

37 lines
1013 B

using System.ComponentModel.Composition;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
13 years ago
namespace MediaBrowser.Controller.Resolvers
{
[Export(typeof(IBaseItemResolver))]
13 years ago
public class FolderResolver : BaseFolderResolver<Folder>
{
public override ResolverPriority Priority
{
get { return ResolverPriority.Last; }
}
13 years ago
protected override Folder Resolve(ItemResolveEventArgs args)
{
if (args.IsDirectory)
13 years ago
{
return new Folder();
}
return null;
}
}
public abstract class BaseFolderResolver<TItemType> : BaseItemResolver<TItemType>
where TItemType : Folder, new()
13 years ago
{
protected override void SetInitialItemValues(TItemType item, ItemResolveEventArgs args)
13 years ago
{
base.SetInitialItemValues(item, args);
13 years ago
item.IsRoot = args.Parent == null;
}
}
}