Merge pull request #5867 from Bond-009/provider

ProviderManager: fix discard and 2 warnings
This commit is contained in:
Bond-009 2021-04-21 13:53:53 +02:00 committed by GitHub
commit 86a2e6eeda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1021,26 +1021,26 @@ namespace MediaBrowser.Providers.Manager
// TODO: Need to hunt down the conditions for this happening // TODO: Need to hunt down the conditions for this happening
_activeRefreshes.AddOrUpdate( _activeRefreshes.AddOrUpdate(
id, id,
(_) => throw new Exception( (_) => throw new InvalidOperationException(
string.Format( string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,
"Cannot update refresh progress of item '{0}' ({1}) because a refresh for this item is not running", "Cannot update refresh progress of item '{0}' ({1}) because a refresh for this item is not running",
item.GetType().Name, item.GetType().Name,
item.Id.ToString("N", CultureInfo.InvariantCulture))), item.Id.ToString("N", CultureInfo.InvariantCulture))),
(_, __) => progress); (_, _) => progress);
RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress))); RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
} }
/// <inheritdoc/> /// <inheritdoc/>
public void QueueRefresh(Guid id, MetadataRefreshOptions options, RefreshPriority priority) public void QueueRefresh(Guid itemId, MetadataRefreshOptions options, RefreshPriority priority)
{ {
if (_disposed) if (_disposed)
{ {
return; return;
} }
_refreshQueue.Enqueue(new Tuple<Guid, MetadataRefreshOptions>(id, options), (int)priority); _refreshQueue.Enqueue(new Tuple<Guid, MetadataRefreshOptions>(itemId, options), (int)priority);
lock (_refreshQueueLock) lock (_refreshQueueLock)
{ {