#nullable disable
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.Resolvers
{
///
/// Class ItemResolver.
///
///
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.
public 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.
BaseItem IItemResolver.ResolvePath(ItemResolveArgs args)
{
var item = Resolve(args);
if (item != null)
{
SetInitialItemValues(item, args);
}
return item;
}
}
}