mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Move MetadataRefreshThrottler to BaseItemManager
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
@@ -19,8 +20,22 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||
public BaseItemManager(IServerConfigurationManager serverConfigurationManager)
|
||||
{
|
||||
_serverConfigurationManager = serverConfigurationManager;
|
||||
|
||||
MetadataRefreshThrottler = new Lazy<SemaphoreSlim>(() => {
|
||||
var concurrency = _serverConfigurationManager.Configuration.LibraryMetadataRefreshConcurrency;
|
||||
|
||||
if (concurrency <= 0)
|
||||
{
|
||||
concurrency = Environment.ProcessorCount;
|
||||
}
|
||||
|
||||
return new SemaphoreSlim(concurrency);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Lazy<SemaphoreSlim> MetadataRefreshThrottler { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsMetadataFetcherEnabled(BaseItem baseItem, LibraryOptions libraryOptions, string name)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user