From 209d7312508c7a02631b4022ff85b08b58bba20f Mon Sep 17 00:00:00 2001 From: Maxr1998 Date: Fri, 4 Mar 2022 18:59:49 +0100 Subject: [PATCH] Sort album tracks by (Parent)IndexNumber, then SortName Track sorting in albums could previously be incorrect if metadata specified a SortName tag. Also see: jellyfin/jellyfin#7323, jellyfin/jellyfin#7324 --- src/controllers/itemDetails/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/itemDetails/index.js b/src/controllers/itemDetails/index.js index 1f29b56d88..9bdc58f96f 100644 --- a/src/controllers/itemDetails/index.js +++ b/src/controllers/itemDetails/index.js @@ -1319,7 +1319,9 @@ function renderChildren(page, item) { Fields: fields }; - if (item.Type !== 'BoxSet') { + if (item.Type == 'MusicAlbum') { + query.SortBy = 'ParentIndexNumber,IndexNumber,SortName'; + } else if (item.Type !== 'BoxSet') { query.SortBy = 'SortName'; }