|
|
@ -13,6 +13,7 @@ using Jellyfin.Data.Events;
|
|
|
|
using MediaBrowser.Common.Net;
|
|
|
|
using MediaBrowser.Common.Net;
|
|
|
|
using MediaBrowser.Common.Progress;
|
|
|
|
using MediaBrowser.Common.Progress;
|
|
|
|
using MediaBrowser.Controller;
|
|
|
|
using MediaBrowser.Controller;
|
|
|
|
|
|
|
|
using MediaBrowser.Controller.BaseItemManager;
|
|
|
|
using MediaBrowser.Controller.Configuration;
|
|
|
|
using MediaBrowser.Controller.Configuration;
|
|
|
|
using MediaBrowser.Controller.Dto;
|
|
|
|
using MediaBrowser.Controller.Dto;
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
@ -51,6 +52,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
private readonly ISubtitleManager _subtitleManager;
|
|
|
|
private readonly ISubtitleManager _subtitleManager;
|
|
|
|
private readonly IServerConfigurationManager _configurationManager;
|
|
|
|
private readonly IServerConfigurationManager _configurationManager;
|
|
|
|
|
|
|
|
private readonly IBaseItemManager _baseItemManager;
|
|
|
|
private readonly ConcurrentDictionary<Guid, double> _activeRefreshes = new ConcurrentDictionary<Guid, double>();
|
|
|
|
private readonly ConcurrentDictionary<Guid, double> _activeRefreshes = new ConcurrentDictionary<Guid, double>();
|
|
|
|
private readonly CancellationTokenSource _disposeCancellationTokenSource = new CancellationTokenSource();
|
|
|
|
private readonly CancellationTokenSource _disposeCancellationTokenSource = new CancellationTokenSource();
|
|
|
|
private readonly SimplePriorityQueue<Tuple<Guid, MetadataRefreshOptions>> _refreshQueue =
|
|
|
|
private readonly SimplePriorityQueue<Tuple<Guid, MetadataRefreshOptions>> _refreshQueue =
|
|
|
@ -74,6 +76,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
/// <param name="fileSystem">The filesystem.</param>
|
|
|
|
/// <param name="fileSystem">The filesystem.</param>
|
|
|
|
/// <param name="appPaths">The server application paths.</param>
|
|
|
|
/// <param name="appPaths">The server application paths.</param>
|
|
|
|
/// <param name="libraryManager">The library manager.</param>
|
|
|
|
/// <param name="libraryManager">The library manager.</param>
|
|
|
|
|
|
|
|
/// <param name="baseItemManager">The BaseItem manager.</param>
|
|
|
|
public ProviderManager(
|
|
|
|
public ProviderManager(
|
|
|
|
IHttpClientFactory httpClientFactory,
|
|
|
|
IHttpClientFactory httpClientFactory,
|
|
|
|
ISubtitleManager subtitleManager,
|
|
|
|
ISubtitleManager subtitleManager,
|
|
|
@ -82,7 +85,8 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
ILogger<ProviderManager> logger,
|
|
|
|
ILogger<ProviderManager> logger,
|
|
|
|
IFileSystem fileSystem,
|
|
|
|
IFileSystem fileSystem,
|
|
|
|
IServerApplicationPaths appPaths,
|
|
|
|
IServerApplicationPaths appPaths,
|
|
|
|
ILibraryManager libraryManager)
|
|
|
|
ILibraryManager libraryManager,
|
|
|
|
|
|
|
|
IBaseItemManager baseItemManager)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger = logger;
|
|
|
|
_logger = logger;
|
|
|
|
_httpClientFactory = httpClientFactory;
|
|
|
|
_httpClientFactory = httpClientFactory;
|
|
|
@ -92,6 +96,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
_appPaths = appPaths;
|
|
|
|
_appPaths = appPaths;
|
|
|
|
_libraryManager = libraryManager;
|
|
|
|
_libraryManager = libraryManager;
|
|
|
|
_subtitleManager = subtitleManager;
|
|
|
|
_subtitleManager = subtitleManager;
|
|
|
|
|
|
|
|
_baseItemManager = baseItemManager;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
@ -398,7 +403,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
|
|
|
|
|
|
|
if (provider is IRemoteMetadataProvider)
|
|
|
|
if (provider is IRemoteMetadataProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!forceEnableInternetMetadata && !item.IsMetadataFetcherEnabled(libraryOptions, provider.Name))
|
|
|
|
if (!forceEnableInternetMetadata && !_baseItemManager.IsMetadataFetcherEnabled(item, libraryOptions, provider.Name))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -442,7 +447,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
|
|
|
|
|
|
|
if (provider is IRemoteImageProvider || provider is IDynamicImageProvider)
|
|
|
|
if (provider is IRemoteImageProvider || provider is IDynamicImageProvider)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!item.IsImageFetcherEnabled(libraryOptions, provider.Name))
|
|
|
|
if (!_baseItemManager.IsImageFetcherEnabled(item, libraryOptions, provider.Name))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|