using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Resolvers; namespace MediaBrowser.Server.Implementations.Library.Resolvers { /// /// Class FolderResolver /// public class FolderResolver : FolderResolver { /// /// Gets the priority. /// /// The priority. public override ResolverPriority Priority { get { return ResolverPriority.Last; } } /// /// Resolves the specified args. /// /// The args. /// Folder. protected override Folder Resolve(ItemResolveArgs args) { if (args.IsDirectory) { if (args.IsPhysicalRoot) { return new AggregateFolder(); } if (args.IsRoot) { return new UserRootFolder(); //if we got here and still a root - must be user root } if (args.IsVf) { return new CollectionFolder(); } return new Folder(); } return null; } } /// /// Class FolderResolver /// /// The type of the T item type. public abstract class FolderResolver : ItemResolver where TItemType : Folder, new() { /// /// Sets the initial item values. /// /// The item. /// The args. protected override void SetInitialItemValues(TItemType item, ItemResolveArgs args) { base.SetInitialItemValues(item, args); item.IsRoot = args.Parent == null; item.IsPhysicalRoot = args.IsPhysicalRoot; } } }