aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-02-01 16:54:59 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-02-01 16:54:59 +0100
commit98b561d62cc978ba805b9e5dadeda9c995c40cb1 (patch)
tree484f21561d8b1c87f5736486035f49dca0e73ad4 /MediaBrowser.Controller
parentd6a8fa14854bf662f394eceffc13a2c921e3a0ff (diff)
Revert RefreshMetadata changes
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs26
1 files changed, 18 insertions, 8 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index ffb5fa14b7..b88572a67f 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -459,11 +459,11 @@ namespace MediaBrowser.Controller.Entities
// If it's an AggregateFolder, don't remove
if (shouldRemove && itemsRemoved.Count > 0)
{
- // Build a set of paths that are alternate versions or additional parts of valid children
+ // Build a set of paths that are alternate versions of valid children
// These items should not be deleted - they're managed by their primary video
- var protectedPaths = validChildren
+ var alternateVersionPaths = validChildren
.OfType<Video>()
- .SelectMany(v => (v.LocalAlternateVersions ?? []).Concat(v.AdditionalParts ?? []))
+ .SelectMany(v => v.LocalAlternateVersions ?? [])
.Where(p => !string.IsNullOrEmpty(p))
.ToHashSet(StringComparer.OrdinalIgnoreCase);
@@ -485,10 +485,10 @@ namespace MediaBrowser.Controller.Entities
continue;
}
- // Check if path is in LocalAlternateVersions or AdditionalParts of any valid child
- if (!string.IsNullOrEmpty(item.Path) && protectedPaths.Contains(item.Path))
+ // Check if path is in LocalAlternateVersions of any valid child
+ if (!string.IsNullOrEmpty(item.Path) && alternateVersionPaths.Contains(item.Path))
{
- Logger.LogDebug("Item path is a protected path (alternate version or additional part), skipping deletion: {Path}", item.Path);
+ Logger.LogDebug("Item path matches an alternate version, skipping deletion: {Path}", item.Path);
continue;
}
}
@@ -569,7 +569,7 @@ namespace MediaBrowser.Controller.Entities
if (container is not null)
{
- await container.RefreshAllMetadata(refreshOptions, progress, cancellationToken).ConfigureAwait(false);
+ await RefreshAllMetadataForContainer(container, refreshOptions, innerProgress, cancellationToken).ConfigureAwait(false);
}
else
{
@@ -593,11 +593,21 @@ namespace MediaBrowser.Controller.Entities
cancellationToken).ConfigureAwait(false);
}
+ private async Task RefreshAllMetadataForContainer(IMetadataContainer container, MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken)
+ {
+ if (container is Series series)
+ {
+ await series.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
+ }
+
+ await container.RefreshAllMetadata(refreshOptions, progress, cancellationToken).ConfigureAwait(false);
+ }
+
private async Task RefreshChildMetadata(BaseItem child, MetadataRefreshOptions refreshOptions, bool recursive, IProgress<double> progress, CancellationToken cancellationToken)
{
if (child is IMetadataContainer container)
{
- await container.RefreshAllMetadata(refreshOptions, progress, cancellationToken).ConfigureAwait(false);
+ await RefreshAllMetadataForContainer(container, refreshOptions, progress, cancellationToken).ConfigureAwait(false);
}
else
{