mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-09 01:08:45 +01:00
Skip local alternates of the primary when merging versions
This commit is contained in:
@@ -216,9 +216,17 @@ public class VideosController : BaseJellyfinApiController
|
||||
}
|
||||
|
||||
var alternateVersionsOfPrimary = primaryVersion.LinkedAlternateVersions.ToList();
|
||||
var localAlternateIds = _libraryManager.GetLocalAlternateVersionIds(primaryVersion).ToHashSet();
|
||||
|
||||
foreach (var item in items.Where(i => !i.Id.Equals(primaryVersion.Id)))
|
||||
{
|
||||
if (localAlternateIds.Contains(item.Id))
|
||||
{
|
||||
// Already a local (file-based) alternate of the primary; linking it would
|
||||
// wrongly mark the group as user-merged (splittable).
|
||||
continue;
|
||||
}
|
||||
|
||||
item.SetPrimaryVersionId(primaryVersion.Id);
|
||||
|
||||
await item.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user