Merge pull request #5383 from cvium/fix-mergeversions-overflow

do not pick a linked item as primary when merging versions
This commit is contained in:
Bond-009 2021-03-05 21:57:22 +01:00 committed by GitHub
commit 3741be51ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,9 +217,7 @@ namespace Jellyfin.Api.Controllers
return BadRequest("Please supply at least two videos to merge.");
}
var videosWithVersions = items.Where(i => i.MediaSourceCount > 1).ToList();
var primaryVersion = videosWithVersions.FirstOrDefault();
var primaryVersion = items.FirstOrDefault(i => i.MediaSourceCount > 1 && string.IsNullOrEmpty(i.PrimaryVersionId));
if (primaryVersion == null)
{
primaryVersion = items