mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-12 03:53:01 +03:00
Only update if actively refreshing (#11341)
This commit is contained in:
@@ -968,16 +968,13 @@ namespace MediaBrowser.Providers.Manager
|
||||
var id = item.Id;
|
||||
_logger.LogDebug("OnRefreshProgress {Id:N} {Progress}", id, progress);
|
||||
|
||||
// TODO: Need to hunt down the conditions for this happening
|
||||
_activeRefreshes.AddOrUpdate(
|
||||
id,
|
||||
_ => throw new InvalidOperationException(
|
||||
string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"Cannot update refresh progress of item '{0}' ({1}) because a refresh for this item is not running",
|
||||
item.GetType().Name,
|
||||
item.Id.ToString("N", CultureInfo.InvariantCulture))),
|
||||
(_, _) => progress);
|
||||
if (!_activeRefreshes.TryGetValue(id, out var current)
|
||||
|| progress <= current
|
||||
|| !_activeRefreshes.TryUpdate(id, progress, current))
|
||||
{
|
||||
// Item isn't currently refreshing, or update was received out-of-order, so don't trigger event.
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user