mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 05:18:27 +01:00
Merge pull request #7039 from 1337joe/providermanager-cleanup
This commit is contained in:
@@ -35,7 +35,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
public SemaphoreSlim MetadataRefreshThrottler { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsMetadataFetcherEnabled(BaseItem baseItem, LibraryOptions libraryOptions, string name)
|
||||
public bool IsMetadataFetcherEnabled(BaseItem baseItem, TypeOptions? libraryTypeOptions, string name)
|
||||
{
|
||||
if (baseItem is Channel)
|
||||
{
|
||||
@@ -49,10 +49,9 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
return !baseItem.EnableMediaSourceDisplay;
|
||||
}
|
||||
|
||||
var typeOptions = libraryOptions.GetTypeOptions(baseItem.GetType().Name);
|
||||
if (typeOptions != null)
|
||||
if (libraryTypeOptions != null)
|
||||
{
|
||||
return typeOptions.MetadataFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
return libraryTypeOptions.MetadataFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
var itemConfig = _serverConfigurationManager.Configuration.MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, baseItem.GetType().Name, StringComparison.OrdinalIgnoreCase));
|
||||
@@ -61,7 +60,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsImageFetcherEnabled(BaseItem baseItem, LibraryOptions libraryOptions, string name)
|
||||
public bool IsImageFetcherEnabled(BaseItem baseItem, TypeOptions? libraryTypeOptions, string name)
|
||||
{
|
||||
if (baseItem is Channel)
|
||||
{
|
||||
@@ -75,10 +74,9 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
return !baseItem.EnableMediaSourceDisplay;
|
||||
}
|
||||
|
||||
var typeOptions = libraryOptions.GetTypeOptions(baseItem.GetType().Name);
|
||||
if (typeOptions != null)
|
||||
if (libraryTypeOptions != null)
|
||||
{
|
||||
return typeOptions.ImageFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
return libraryTypeOptions.ImageFetchers.Contains(name.AsSpan(), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
var itemConfig = _serverConfigurationManager.Configuration.MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, baseItem.GetType().Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
@@ -18,18 +18,18 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
/// Is metadata fetcher enabled.
|
||||
/// </summary>
|
||||
/// <param name="baseItem">The base item.</param>
|
||||
/// <param name="libraryOptions">The library options.</param>
|
||||
/// <param name="libraryTypeOptions">The type options for <c>baseItem</c> from the library (if defined).</param>
|
||||
/// <param name="name">The metadata fetcher name.</param>
|
||||
/// <returns><c>true</c> if metadata fetcher is enabled, else false.</returns>
|
||||
bool IsMetadataFetcherEnabled(BaseItem baseItem, LibraryOptions libraryOptions, string name);
|
||||
bool IsMetadataFetcherEnabled(BaseItem baseItem, TypeOptions? libraryTypeOptions, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Is image fetcher enabled.
|
||||
/// </summary>
|
||||
/// <param name="baseItem">The base item.</param>
|
||||
/// <param name="libraryOptions">The library options.</param>
|
||||
/// <param name="libraryTypeOptions">The type options for <c>baseItem</c> from the library (if defined).</param>
|
||||
/// <param name="name">The image fetcher name.</param>
|
||||
/// <returns><c>true</c> if image fetcher is enabled, else false.</returns>
|
||||
bool IsImageFetcherEnabled(BaseItem baseItem, LibraryOptions libraryOptions, string name);
|
||||
bool IsImageFetcherEnabled(BaseItem baseItem, TypeOptions? libraryTypeOptions, string name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,11 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// <returns><c>true</c> if this instance can refresh the specified item.</returns>
|
||||
bool CanRefresh(BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this instance primarily targets the specified type.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <returns><c>true</c> if this instance primarily targets the specified type.</returns>
|
||||
bool CanRefreshPrimary(Type type);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -131,6 +131,24 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// <returns>IEnumerable{ImageProviderInfo}.</returns>
|
||||
IEnumerable<ImageProviderInfo> GetRemoteImageProviderInfo(BaseItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the image providers for the provided item.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="refreshOptions">The image refresh options.</param>
|
||||
/// <returns>The image providers for the item.</returns>
|
||||
IEnumerable<IImageProvider> GetImageProviders(BaseItem item, ImageRefreshOptions refreshOptions);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the metadata providers for the provided item.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="libraryOptions">The library options.</param>
|
||||
/// <typeparam name="T">The type of metadata provider.</typeparam>
|
||||
/// <returns>The metadata providers.</returns>
|
||||
IEnumerable<IMetadataProvider<T>> GetMetadataProviders<T>(BaseItem item, LibraryOptions libraryOptions)
|
||||
where T : BaseItem;
|
||||
|
||||
/// <summary>
|
||||
/// Gets all metadata plugins.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user