From ab62ec689d4ad9ebe45eaaf825ad645505e0dc64 Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 7 Jan 2022 17:26:12 -0600 Subject: [PATCH] Fix:Sort series before limiting #295 --- server/controllers/LibraryController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index 286704be..3c3ebf05 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -167,6 +167,7 @@ class LibraryController { } var series = libraryHelpers.getSeriesFromBooks(audiobooks, payload.minified) + series = sort(series).asc(s => s.name) payload.total = series.length if (payload.limit) { @@ -174,7 +175,7 @@ class LibraryController { series = series.slice(startIndex, startIndex + payload.limit) } - payload.results = sort(series).asc(s => s.name) + payload.results = series res.json(payload) }