diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-05-06 20:49:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-06 20:49:19 +0200 |
| commit | 33ed52b8ee25e1fae4763a26337b838dc9782b26 (patch) | |
| tree | ee68da202f604eef267254ea8c689965098b1c3e /MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs | |
| parent | aa96ff42e616ecf5638a8f1e2e8459b94513c528 (diff) | |
| parent | d1ab428476f961426841a0561036c59c3b93878e (diff) | |
Merge branch 'master' into feature/season-provider-id-from-path
Diffstat (limited to 'MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs')
| -rw-r--r-- | MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs b/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs index eccf8a606d..5f80151dd3 100644 --- a/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs +++ b/MediaBrowser.Providers/BoxSets/BoxSetMetadataService.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using MediaBrowser.Controller.Configuration; @@ -69,8 +70,18 @@ public class BoxSetMetadataService : MetadataService<BoxSet, BoxSetInfo> if (mergeMetadataSettings) { - // TODO: Change to only replace when currently empty or requested. This is currently not done because the metadata service is not handling attaching collection items based on the provider responses - targetItem.LinkedChildren = sourceItem.LinkedChildren.Concat(targetItem.LinkedChildren).DistinctBy(i => i.Path).ToArray(); + // Only merge LinkedChildren from metadata for external collections (not managed by Jellyfin). + // For internal collections, the database LinkedChildren table is the source of truth. + var targetPath = targetItem.Path; + if (!string.IsNullOrEmpty(targetPath) + && !FileSystem.ContainsSubPath(ServerConfigurationManager.ApplicationPaths.DataPath, targetPath)) + { +#pragma warning disable CS0618 // Type or member is obsolete - fallback for legacy path-based dedup + targetItem.LinkedChildren = sourceItem.LinkedChildren.Concat(targetItem.LinkedChildren) + .DistinctBy(i => i.ItemId.HasValue && !i.ItemId.Value.Equals(Guid.Empty) ? i.ItemId.Value.ToString() : i.Path ?? string.Empty) + .ToArray(); +#pragma warning restore CS0618 + } } } |
