mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
fix: respect the image refresh options when parsing remote images from NFO
This commit is contained in:
parent
93941f9728
commit
5204863705
2 changed files with 8 additions and 14 deletions
|
@ -34,8 +34,8 @@ namespace MediaBrowser.Controller.Providers
|
||||||
|
|
||||||
public bool IsReplacingImage(ImageType type)
|
public bool IsReplacingImage(ImageType type)
|
||||||
{
|
{
|
||||||
return ImageRefreshMode == MetadataRefreshMode.FullRefresh &&
|
return ImageRefreshMode == MetadataRefreshMode.FullRefresh
|
||||||
(ReplaceAllImages || ReplaceImages.Contains(type));
|
&& (ReplaceAllImages || ReplaceImages.Contains(type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -655,8 +655,6 @@ namespace MediaBrowser.Providers.Manager
|
||||||
};
|
};
|
||||||
temp.Item.Path = item.Path;
|
temp.Item.Path = item.Path;
|
||||||
|
|
||||||
var userDataList = new List<UserItemData>();
|
|
||||||
|
|
||||||
// If replacing all metadata, run internet providers first
|
// If replacing all metadata, run internet providers first
|
||||||
if (options.ReplaceAllMetadata)
|
if (options.ReplaceAllMetadata)
|
||||||
{
|
{
|
||||||
|
@ -670,7 +668,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
|
|
||||||
var hasLocalMetadata = false;
|
var hasLocalMetadata = false;
|
||||||
|
|
||||||
foreach (var provider in providers.OfType<ILocalMetadataProvider<TItemType>>().ToList())
|
foreach (var provider in providers.OfType<ILocalMetadataProvider<TItemType>>())
|
||||||
{
|
{
|
||||||
var providerName = provider.GetType().Name;
|
var providerName = provider.GetType().Name;
|
||||||
Logger.LogDebug("Running {Provider} for {Item}", providerName, logName);
|
Logger.LogDebug("Running {Provider} for {Item}", providerName, logName);
|
||||||
|
@ -687,6 +685,11 @@ namespace MediaBrowser.Providers.Manager
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (!options.IsReplacingImage(remoteImage.Type))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
await ProviderManager.SaveImage(item, remoteImage.Url, remoteImage.Type, null, cancellationToken).ConfigureAwait(false);
|
await ProviderManager.SaveImage(item, remoteImage.Url, remoteImage.Type, null, cancellationToken).ConfigureAwait(false);
|
||||||
refreshResult.UpdateType |= ItemUpdateType.ImageUpdate;
|
refreshResult.UpdateType |= ItemUpdateType.ImageUpdate;
|
||||||
}
|
}
|
||||||
|
@ -701,11 +704,6 @@ namespace MediaBrowser.Providers.Manager
|
||||||
refreshResult.UpdateType |= ItemUpdateType.ImageUpdate;
|
refreshResult.UpdateType |= ItemUpdateType.ImageUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localItem.UserDataList != null)
|
|
||||||
{
|
|
||||||
userDataList.AddRange(localItem.UserDataList);
|
|
||||||
}
|
|
||||||
|
|
||||||
MergeData(localItem, temp, Array.Empty<MetadataField>(), !options.ReplaceAllMetadata, true);
|
MergeData(localItem, temp, Array.Empty<MetadataField>(), !options.ReplaceAllMetadata, true);
|
||||||
refreshResult.UpdateType |= ItemUpdateType.MetadataImport;
|
refreshResult.UpdateType |= ItemUpdateType.MetadataImport;
|
||||||
|
|
||||||
|
@ -764,15 +762,11 @@ namespace MediaBrowser.Providers.Manager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// var isUnidentified = failedProviderCount > 0 && successfulProviderCount == 0;
|
|
||||||
|
|
||||||
foreach (var provider in customProviders.Where(i => i is not IPreRefreshProvider))
|
foreach (var provider in customProviders.Where(i => i is not IPreRefreshProvider))
|
||||||
{
|
{
|
||||||
await RunCustomProvider(provider, item, logName, options, refreshResult, cancellationToken).ConfigureAwait(false);
|
await RunCustomProvider(provider, item, logName, options, refreshResult, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImportUserData(item, userDataList, cancellationToken);
|
|
||||||
|
|
||||||
return refreshResult;
|
return refreshResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue