瀏覽代碼

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
Mister Rajoy 5 年之前
父節點
當前提交
1b90798b90
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      MediaBrowser.Api/VideosService.cs

+ 2 - 0
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)
             {