aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMister Rajoy <danielarezdiaz@gmail.com>2020-05-31 20:23:23 +0200
committerMister Rajoy <danielarezdiaz@gmail.com>2020-05-31 20:23:23 +0200
commit1b90798b90fc4e5f7fe8d813c34c87f519924abc (patch)
treeb8a32a44910998bf7082a34dee3a4e8b130263c6
parent730395886db06ef83fa7e6f29fd95666519eb458 (diff)
Order ids to merge to avoid stack overflow
As said in https://github.com/jellyfin/jellyfin/issues/3176, merging 1 with 2 and then 2 with 1 cause an stack overflow. sorting ids first fix the problem
-rw-r--r--MediaBrowser.Api/VideosService.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/MediaBrowser.Api/VideosService.cs b/MediaBrowser.Api/VideosService.cs
index b11fd48d3..e03542d37 100644
--- a/MediaBrowser.Api/VideosService.cs
+++ b/MediaBrowser.Api/VideosService.cs
@@ -125,10 +125,12 @@ namespace MediaBrowser.Api
public void Post(MergeVersions request)
{
+
var items = request.Ids.Split(',')
.Select(i => _libraryManager.GetItemById(i))
.OfType<Video>()
.ToList();
+ items = items.OrderBy(i => i.Id).ToList();
if (items.Count < 2)
{