Remove local metadata stop logic

This commit is contained in:
Shadowghost 2024-05-22 07:38:53 +02:00
parent f5a8fca22f
commit 9145be6bfc
12 changed files with 1 additions and 146 deletions

View File

@ -751,9 +751,6 @@ namespace MediaBrowser.Controller.Entities
[JsonIgnore]
public virtual bool SupportsAncestors => true;
[JsonIgnore]
public virtual bool StopRefreshIfLocalMetadataFound => true;
[JsonIgnore]
protected virtual bool SupportsOwnedItems => !ParentId.IsEmpty() && IsFileProtocol;

View File

@ -45,9 +45,6 @@ namespace MediaBrowser.Controller.Entities.Movies
set => TmdbCollectionName = value;
}
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
public override double GetDefaultPrimaryImageAspectRatio()
{
// hack for tv plugins

View File

@ -72,9 +72,6 @@ namespace MediaBrowser.Controller.Entities.TV
/// <value>The status.</value>
public SeriesStatus? Status { get; set; }
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
public override double GetDefaultPrimaryImageAspectRatio()
{
double value = 2;

View File

@ -23,9 +23,6 @@ namespace MediaBrowser.Controller.Entities
TrailerTypes = Array.Empty<TrailerType>();
}
[JsonIgnore]
public override bool StopRefreshIfLocalMetadataFound => false;
public TrailerType[] TrailerTypes { get; set; }
public override double GetDefaultPrimaryImageAspectRatio()

View File

@ -730,9 +730,8 @@ namespace MediaBrowser.Providers.Manager
}
}
var hasLocalBaseMetadata = HasBaseMetadata(temp.Item);
var isLocalLocked = temp.Item.IsLocked;
if (!isLocalLocked && !(hasLocalBaseMetadata && item.StopRefreshIfLocalMetadataFound) && (options.ReplaceAllMetadata || options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh))
if (!isLocalLocked && (options.ReplaceAllMetadata || options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh))
{
var remoteResult = await ExecuteRemoteProviders(temp, logName, false, id, providers.OfType<IRemoteMetadataProvider<TItemType, TIdType>>(), cancellationToken)
.ConfigureAwait(false);
@ -773,16 +772,6 @@ namespace MediaBrowser.Providers.Manager
return refreshResult;
}
protected virtual bool HasBaseMetadata(TItemType item)
{
if (string.IsNullOrWhiteSpace(item.Name))
{
return false;
}
return true;
}
private async Task RunCustomProvider(ICustomMetadataProvider<TItemType> provider, TItemType item, string logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken)
{
Logger.LogDebug("Running {Provider} for {Item}", provider.GetType().Name, logName);

View File

@ -23,22 +23,6 @@ namespace MediaBrowser.Providers.Movies
{
}
/// <inheritdoc />
protected override bool HasBaseMetadata(Movie item)
{
if (string.IsNullOrWhiteSpace(item.Overview))
{
return false;
}
if (!item.ProductionYear.HasValue)
{
return false;
}
return base.HasBaseMetadata(item);
}
/// <inheritdoc />
protected override void MergeData(MetadataResult<Movie> source, MetadataResult<Movie> target, MetadataField[] lockedFields, bool replaceData, bool mergeMetadataSettings)
{

View File

@ -24,22 +24,6 @@ namespace MediaBrowser.Providers.Movies
{
}
/// <inheritdoc />
protected override bool HasBaseMetadata(Trailer item)
{
if (string.IsNullOrWhiteSpace(item.Overview))
{
return false;
}
if (!item.ProductionYear.HasValue)
{
return false;
}
return base.HasBaseMetadata(item);
}
/// <inheritdoc />
protected override void MergeData(MetadataResult<Trailer> source, MetadataResult<Trailer> target, MetadataField[] lockedFields, bool replaceData, bool mergeMetadataSettings)
{

View File

@ -208,27 +208,6 @@ namespace MediaBrowser.Providers.Music
return updateType;
}
/// <inheritdoc />
protected override bool HasBaseMetadata(MusicAlbum item)
{
if (string.IsNullOrWhiteSpace(item.Album))
{
return false;
}
if (item.AlbumArtists.Count == 0 && item.Artists.Count == 0)
{
return false;
}
if (!item.ProductionYear.HasValue)
{
return false;
}
return base.HasBaseMetadata(item);
}
/// <inheritdoc />
protected override void MergeData(
MetadataResult<MusicAlbum> source,

View File

@ -49,27 +49,6 @@ namespace MediaBrowser.Providers.Music
}
}
/// <inheritdoc />
protected override bool HasBaseMetadata(Audio item)
{
if (item.IndexNumber is null)
{
return false;
}
if (string.IsNullOrEmpty(item.Album))
{
return false;
}
if (item.AlbumArtists.Count == 0 && item.Artists.Count == 0)
{
return false;
}
return base.HasBaseMetadata(item);
}
/// <inheritdoc />
protected override void MergeData(MetadataResult<Audio> source, MetadataResult<Audio> target, MetadataField[] lockedFields, bool replaceData, bool mergeMetadataSettings)
{

View File

@ -67,22 +67,6 @@ namespace MediaBrowser.Providers.TV
return updatedType;
}
/// <inheritdoc />
protected override bool HasBaseMetadata(Episode item)
{
if (string.IsNullOrWhiteSpace(item.Overview))
{
return false;
}
if (item.IndexNumber is null)
{
return false;
}
return base.HasBaseMetadata(item);
}
/// <inheritdoc />
protected override void MergeData(MetadataResult<Episode> source, MetadataResult<Episode> target, MetadataField[] lockedFields, bool replaceData, bool mergeMetadataSettings)
{

View File

@ -99,21 +99,5 @@ namespace MediaBrowser.Providers.TV
return ItemUpdateType.None;
}
/// <inheritdoc />
protected override bool HasBaseMetadata(Season item)
{
if (string.IsNullOrWhiteSpace(item.Overview))
{
return false;
}
if (item.IndexNumber is null)
{
return false;
}
return base.HasBaseMetadata(item);
}
}
}

View File

@ -65,22 +65,6 @@ namespace MediaBrowser.Providers.TV
await UpdateAndCreateSeasonsAsync(item, cancellationToken).ConfigureAwait(false);
}
/// <inheritdoc />
protected override bool HasBaseMetadata(Series item)
{
if (string.IsNullOrWhiteSpace(item.Overview))
{
return false;
}
if (!item.ProductionYear.HasValue)
{
return false;
}
return base.HasBaseMetadata(item);
}
/// <inheritdoc />
protected override void MergeData(MetadataResult<Series> source, MetadataResult<Series> target, MetadataField[] lockedFields, bool replaceData, bool mergeMetadataSettings)
{