#nullable disable using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; namespace MediaBrowser.Controller.Resolvers { /// /// Class ItemResolver. /// /// The type of BaseItem. public abstract class ItemResolver : IItemResolver where T : BaseItem, new() { /// /// Gets the priority. /// /// The priority. public virtual ResolverPriority Priority => ResolverPriority.First; /// /// Resolves the specified args. /// /// The args. /// `0. protected internal virtual T Resolve(ItemResolveArgs args) { return null; } /// /// Sets initial values on the newly resolved item. /// /// The item. /// The args. protected virtual void SetInitialItemValues(T item, ItemResolveArgs args) { } /// /// Resolves the path. /// /// The args. /// BaseItem. public BaseItem ResolvePath(ItemResolveArgs args) { var item = Resolve(args); if (item != null) { SetInitialItemValues(item, args); } return item; } } }