|
|
@ -970,20 +970,18 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
var id = item.Id;
|
|
|
|
var id = item.Id;
|
|
|
|
_logger.LogInformation("OnRefreshProgress {0} {1}", id.ToString("N", CultureInfo.InvariantCulture), progress);
|
|
|
|
_logger.LogInformation("OnRefreshProgress {0} {1}", id.ToString("N", CultureInfo.InvariantCulture), progress);
|
|
|
|
|
|
|
|
|
|
|
|
if (_activeRefreshes.TryAdd(id, progress))
|
|
|
|
// TODO: Need to hunt down the conditions for this happening
|
|
|
|
{
|
|
|
|
_activeRefreshes.AddOrUpdate(
|
|
|
|
RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
|
|
|
|
id,
|
|
|
|
}
|
|
|
|
(_) => throw new Exception(
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// TODO: Need to hunt down the conditions for this happening
|
|
|
|
|
|
|
|
throw new Exception(
|
|
|
|
|
|
|
|
string.Format(
|
|
|
|
string.Format(
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
CultureInfo.InvariantCulture,
|
|
|
|
"Refresh for item {0} {1} is not in progress",
|
|
|
|
"Refresh for item {0} {1} is not in progress",
|
|
|
|
item.GetType().Name,
|
|
|
|
item.GetType().Name,
|
|
|
|
item.Id.ToString("N", CultureInfo.InvariantCulture)));
|
|
|
|
item.Id.ToString("N", CultureInfo.InvariantCulture))),
|
|
|
|
}
|
|
|
|
(_, _) => progress);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RefreshProgress?.Invoke(this, new GenericEventArgs<Tuple<BaseItem, double>>(new Tuple<BaseItem, double>(item, progress)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private readonly SimplePriorityQueue<Tuple<Guid, MetadataRefreshOptions>> _refreshQueue =
|
|
|
|
private readonly SimplePriorityQueue<Tuple<Guid, MetadataRefreshOptions>> _refreshQueue =
|
|
|
|