Fix BoxSet sorting (#14919)

Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
theguymadmax 2025-10-01 23:10:31 -04:00 committed by GitHub
parent cce6bf27e0
commit 0f42aa892e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1351,6 +1351,14 @@ namespace MediaBrowser.Controller.Entities
var realChildren = visibleChildren
.Where(e => query is null || UserViewBuilder.FilterItem(e, query))
.ToArray();
if (this is BoxSet && (query.OrderBy is null || query.OrderBy.Count == 0))
{
realChildren = realChildren
.OrderBy(e => e.ProductionYear ?? int.MaxValue)
.ToArray();
}
var childCount = realChildren.Length;
if (result.Count < limit)
{