aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/VideosController.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2021-03-05 21:57:22 +0100
committerGitHub <noreply@github.com>2021-03-05 21:57:22 +0100
commit3741be51ec4b44f946bcdc3ad4f5232af0e2e929 (patch)
treeabef08cc65d76e97ec40f91831b3db6a2c1691af /Jellyfin.Api/Controllers/VideosController.cs
parent1d87274cc28da1562a69796b9ad86e044d07a61a (diff)
parent59814bd55e8c6c5fbd167e90403b9bd2e390c78c (diff)
Merge pull request #5383 from cvium/fix-mergeversions-overflow
do not pick a linked item as primary when merging versions
Diffstat (limited to 'Jellyfin.Api/Controllers/VideosController.cs')
-rw-r--r--Jellyfin.Api/Controllers/VideosController.cs4
1 files changed, 1 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/VideosController.cs b/Jellyfin.Api/Controllers/VideosController.cs
index 8c7aa7325..99654e7b0 100644
--- a/Jellyfin.Api/Controllers/VideosController.cs
+++ b/Jellyfin.Api/Controllers/VideosController.cs
@@ -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