[PR #1105] [MERGED] Patching handling of titles with multiple series #3444

Closed
opened 2026-04-25 00:15:41 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/1105
Author: @ruoti
Created: 10/30/2022
Status: Merged
Merged: 11/6/2022
Merged by: @advplyr

Base: masterHead: collapseseries-patch


📝 Commits (6)

  • d64932d Fixes bug when titles are in multiple series being collapsed
  • b322d02 Fixed sorting to be more consistent for multiple series (and generally)
  • c1035d9 Show book sequences for collapsed series when filtering by series
  • b111191 Added sorting by sequence for series and collapsing series in series view
  • 7425622 Merge branch 'master' into collapseseries-patch
  • 24d97d1 Add collapseBookSeries to default settings

📊 Changes

7 files changed (+348 additions, -160 deletions)

View changed files

📝 client/components/app/BookShelfToolbar.vue (+13 -4)
📝 client/components/app/LazyBookshelf.vue (+28 -8)
📝 client/components/cards/LazyBookCard.vue (+91 -30)
📝 client/components/controls/LibrarySortSelect.vue (+83 -47)
📝 client/store/user.js (+2 -1)
📝 server/controllers/LibraryController.js (+101 -42)
📝 server/utils/libraryHelpers.js (+30 -28)

📄 Description

I noticed that there was an issue with the "Collapse Series" option in the Library view that happens when a book is in two series at the same time. For example, in the Pern series of books, the first three books are part of a trilogy (series A) and part of the overall Pern universe (series B). If I label them as such, one of those series will disappear from the view, even though both should be shown. They still show up in the series list, so this is just a display issue.

While fixing this problem, I also noticed that code for sorting books attached to multiple series wouldn't work correctly as sorting happened before collapsing. I've reworked the sorting to have collapsing occur first, then sorting after that. I also fixed a couple of other small issues with sorting:

  1. When series are put at the end of the list of titles (happens when not sorting by title), they are now sorted alphabetically.
  2. In the above case, a series will appear after books beginning with 'zzzzz', which they wouldn't have before. Admittedly, this would probably never happen, but I was here so I fixed it anyways.
  3. If filtering by series, the code would resort after the initial sort. I moved this into the normal sort workflow.

The one non-obvious thing I did was make it so that when filtering by a series and collapsing series at the same time, I do not collapse the titles that are only in the series being filtered. This didn't make sense as you would select a series just to see a single item with that series (unless you had titles with multiple series). Along with my change #3 above, this results in cool functionality where subseries are displayed in order in this case. For example, If there was a trilogy, then a standalone book, then another trilogy, it would show them in this order. Nice for larger series made up of many sub-series (e.g., Dragonlance).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/1105 **Author:** [@ruoti](https://github.com/ruoti) **Created:** 10/30/2022 **Status:** ✅ Merged **Merged:** 11/6/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `collapseseries-patch` --- ### 📝 Commits (6) - [`d64932d`](https://github.com/advplyr/audiobookshelf/commit/d64932dad70c0be31375b99c92fd2c994007bb58) Fixes bug when titles are in multiple series being collapsed - [`b322d02`](https://github.com/advplyr/audiobookshelf/commit/b322d0207bdea39007122b70e7d239638ac95986) Fixed sorting to be more consistent for multiple series (and generally) - [`c1035d9`](https://github.com/advplyr/audiobookshelf/commit/c1035d97e8d988269b896bc78a112e7ca1232cff) Show book sequences for collapsed series when filtering by series - [`b111191`](https://github.com/advplyr/audiobookshelf/commit/b1111912f74a8eae70c2087b6deeed9d5937db62) Added sorting by sequence for series and collapsing series in series view - [`7425622`](https://github.com/advplyr/audiobookshelf/commit/7425622d93b1196a52118b9963dbb8408499f2f2) Merge branch 'master' into collapseseries-patch - [`24d97d1`](https://github.com/advplyr/audiobookshelf/commit/24d97d17ba25b5ab943c34952156db8b7a93b529) Add collapseBookSeries to default settings ### 📊 Changes **7 files changed** (+348 additions, -160 deletions) <details> <summary>View changed files</summary> 📝 `client/components/app/BookShelfToolbar.vue` (+13 -4) 📝 `client/components/app/LazyBookshelf.vue` (+28 -8) 📝 `client/components/cards/LazyBookCard.vue` (+91 -30) 📝 `client/components/controls/LibrarySortSelect.vue` (+83 -47) 📝 `client/store/user.js` (+2 -1) 📝 `server/controllers/LibraryController.js` (+101 -42) 📝 `server/utils/libraryHelpers.js` (+30 -28) </details> ### 📄 Description I noticed that there was an issue with the "Collapse Series" option in the Library view that happens when a book is in two series at the same time. For example, in the Pern series of books, the first three books are part of a trilogy (series A) and part of the overall Pern universe (series B). If I label them as such, one of those series will disappear from the view, even though both should be shown. They still show up in the series list, so this is just a display issue. While fixing this problem, I also noticed that code for sorting books attached to multiple series wouldn't work correctly as sorting happened before collapsing. I've reworked the sorting to have collapsing occur first, then sorting after that. I also fixed a couple of other small issues with sorting: 1. When series are put at the end of the list of titles (happens when not sorting by title), they are now sorted alphabetically. 2. In the above case, a series will appear after books beginning with 'zzzzz', which they wouldn't have before. Admittedly, this would probably never happen, but I was here so I fixed it anyways. 3. If filtering by series, the code would resort after the initial sort. I moved this into the normal sort workflow. The one non-obvious thing I did was make it so that when filtering by a series and collapsing series at the same time, I do not collapse the titles that are only in the series being filtered. This didn't make sense as you would select a series just to see a single item with that series (unless you had titles with multiple series). Along with my change #3 above, this results in cool functionality where subseries are displayed in order in this case. For example, If there was a trilogy, then a standalone book, then another trilogy, it would show them in this order. Nice for larger series made up of many sub-series (e.g., Dragonlance). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:15:41 +02:00
adam closed this issue 2026-04-25 00:15:41 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3444