Skip to content

Commit

Permalink
Update:Series books page fallback to sort by title/collapsed series n…
Browse files Browse the repository at this point in the history
…ame when no sequence #1503
  • Loading branch information
advplyr committed Mar 5, 2023
1 parent 3df7caa commit 785942b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/controllers/LibraryController.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,16 @@ class LibraryController {
if (payload.sortBy === 'book.volumeNumber') payload.sortBy = null // TODO: Remove temp fix after mobile release 0.9.60
if (filterSeries && !payload.sortBy) {
sortArray.push({ asc: (li) => li.media.metadata.getSeries(filterSeries).sequence })
// If no series sequence then fallback to sorting by title (or collapsed series name for sub-series)
sortArray.push({
asc: (li) => {
if (this.db.serverSettings.sortingIgnorePrefix) {
return li.collapsedSeries?.nameIgnorePrefix || li.media.metadata.titleIgnorePrefix
} else {
return li.collapsedSeries?.name || li.media.metadata.title
}
}
})
}

if (payload.sortBy) {
Expand Down

0 comments on commit 785942b

Please sign in to comment.