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.
37 lines
1012 B
37 lines
1012 B
using System.ComponentModel.Composition;
|
|
using MediaBrowser.Controller.Events;
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
namespace MediaBrowser.Controller.Resolvers
|
|
{
|
|
[Export(typeof(IBaseItemResolver))]
|
|
public class FolderResolver : BaseFolderResolver<Folder>
|
|
{
|
|
public override ResolverPriority Priority
|
|
{
|
|
get { return ResolverPriority.Last; }
|
|
}
|
|
|
|
protected override Folder Resolve(ItemResolveEventArgs args)
|
|
{
|
|
if (args.IsDirectory)
|
|
{
|
|
return new Folder();
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public abstract class BaseFolderResolver<TItemType> : BaseItemResolver<TItemType>
|
|
where TItemType : Folder, new()
|
|
{
|
|
protected override void SetInitialItemValues(TItemType item, ItemResolveEventArgs args)
|
|
{
|
|
base.SetInitialItemValues(item, args);
|
|
|
|
item.IsRoot = args.Parent == null;
|
|
}
|
|
}
|
|
}
|