mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
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
This commit is contained in:
parent
730395886d
commit
1b90798b90
@ -125,10 +125,12 @@ namespace MediaBrowser.Api
|
|||||||
|
|
||||||
public void Post(MergeVersions request)
|
public void Post(MergeVersions request)
|
||||||
{
|
{
|
||||||
|
|
||||||
var items = request.Ids.Split(',')
|
var items = request.Ids.Split(',')
|
||||||
.Select(i => _libraryManager.GetItemById(i))
|
.Select(i => _libraryManager.GetItemById(i))
|
||||||
.OfType<Video>()
|
.OfType<Video>()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
items = items.OrderBy(i => i.Id).ToList();
|
||||||
|
|
||||||
if (items.Count < 2)
|
if (items.Count < 2)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user