From 60aeb237979ebb07b9b72796f29aa0e7627cf8b3 Mon Sep 17 00:00:00 2001 From: Igor Kaldowski Date: Sat, 4 Dec 2021 22:10:26 +0000 Subject: [PATCH] Fix Series Sort --- server/controllers/LibraryController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index 1650d566..dbe35425 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -179,7 +179,7 @@ class LibraryController { series = series.slice(startIndex, startIndex + payload.limit) } - payload.results = series + payload.results = sort(series).asc(s => s.name) res.json(payload) } @@ -194,7 +194,7 @@ class LibraryController { return res.status(404).send('Series not found') } audiobooks = sort(audiobooks).asc(ab => { - return ab.book.volumeNumber + return Number(ab.book.volumeNumber) }) res.json({ results: audiobooks.map(ab => ab.toJSONExpanded()),