mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
Add OnConfigurationUpdated method
This commit is contained in:
parent
2b6b2cbf31
commit
a9367b6169
|
@ -27,15 +27,7 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||||
_metadataRefreshConcurrency = GetMetadataRefreshConcurrency();
|
_metadataRefreshConcurrency = GetMetadataRefreshConcurrency();
|
||||||
SetupMetadataThrottler();
|
SetupMetadataThrottler();
|
||||||
|
|
||||||
_serverConfigurationManager.ConfigurationUpdated += (object sender, EventArgs e) =>
|
_serverConfigurationManager.ConfigurationUpdated += OnConfigurationUpdated;
|
||||||
{
|
|
||||||
int newMetadataRefreshConcurrency = GetMetadataRefreshConcurrency();
|
|
||||||
if (_metadataRefreshConcurrency != newMetadataRefreshConcurrency)
|
|
||||||
{
|
|
||||||
_metadataRefreshConcurrency = newMetadataRefreshConcurrency;
|
|
||||||
SetupMetadataThrottler();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -103,6 +95,20 @@ namespace MediaBrowser.Controller.BaseItemManager
|
||||||
return itemConfig == null || !itemConfig.DisabledImageFetchers.Contains(name, StringComparer.OrdinalIgnoreCase);
|
return itemConfig == null || !itemConfig.DisabledImageFetchers.Contains(name, StringComparer.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the configuration is updated.
|
||||||
|
/// It will refresh the metadata throttler if the relevant config changed.
|
||||||
|
/// </summary>
|
||||||
|
private void OnConfigurationUpdated(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int newMetadataRefreshConcurrency = GetMetadataRefreshConcurrency();
|
||||||
|
if (_metadataRefreshConcurrency != newMetadataRefreshConcurrency)
|
||||||
|
{
|
||||||
|
_metadataRefreshConcurrency = newMetadataRefreshConcurrency;
|
||||||
|
SetupMetadataThrottler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the metadata refresh throttler.
|
/// Creates the metadata refresh throttler.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue