[Enhancement] Use title as secondary sort when sorting books by author #2829

Closed
opened 2026-04-25 00:11:01 +02:00 by adam · 6 comments
Owner

Originally created by @RChesterton on GitHub (Jun 5, 2025).

What happened?

When sorting the Library view by Author, the books under each Author appear to sort randomly (or possibly by when they were picked up by the scanner/added date?).

For example, see this thread; https://www.reddit.com/r/audiobookshelf/comments/1l3y9bl/sort_order/

What did you expect to happen?

I expected a logical sort order within each Author, maybe by title or even release date.

Steps to reproduce the issue

  1. Sort Library by Author.
  2. View the books for an Author in the list.

Audiobookshelf version

v2.24.0

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Chrome

Logs


Additional Notes

No response

Originally created by @RChesterton on GitHub (Jun 5, 2025). ### What happened? When sorting the Library view by Author, the books under each Author appear to sort randomly (or possibly by when they were picked up by the scanner/added date?). For example, see this thread; https://www.reddit.com/r/audiobookshelf/comments/1l3y9bl/sort_order/ ### What did you expect to happen? I expected a logical sort order within each Author, maybe by title or even release date. ### Steps to reproduce the issue 1. Sort Library by Author. 2. View the books for an Author in the list. ### Audiobookshelf version v2.24.0 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Chrome ### Logs ```shell ``` ### Additional Notes _No response_
adam added the enhancement label 2026-04-25 00:11:01 +02:00
adam closed this issue 2026-04-25 00:11:01 +02:00
Author
Owner

@averageyogi commented on GitHub (Jun 6, 2025):

Duplicate #1674, at least the same issue if a different way to see it. What I think is trying to be said here is first filter to a single author, then sort by Author. The default sort (used here because the author is all the same for every item) is by Added At date, where Publish Year would make more sense. This is the same issue as with items in a series without a series sequence number.

@averageyogi commented on GitHub (Jun 6, 2025): Duplicate #1674, at least the same issue if a different way to see it. What I think is trying to be said here is first filter to a single author, then sort by Author. The default sort (used here because the author is all the same for every item) is by Added At date, where Publish Year would make more sense. This is the same issue as with items in a series without a series sequence number.
Author
Owner

@RChesterton commented on GitHub (Jun 6, 2025):

Duplicate #1674, at least the same issue if a different way to see it. What I think is trying to be said here is first filter to a single author, then sort by Author. The default sort (used here because the author is all the same for every item) is by Added At date, where Publish Year would make more sense. This is the same issue as with items in a series without a series sequence number.

No, I am not filtering, only sorting (as detailed in my OP).

All authors still displayed, but within each one the sorting seems arbitrary/incorrect.

The issue can be seen below. Both series have sequence numbers.

Image

@RChesterton commented on GitHub (Jun 6, 2025): > Duplicate [#1674](https://github.com/advplyr/audiobookshelf/issues/1674), at least the same issue if a different way to see it. What I think is trying to be said here is first filter to a single author, then sort by Author. The default sort (used here because the author is all the same for every item) is by Added At date, where Publish Year would make more sense. This is the same issue as with items in a series without a series sequence number. No, I am not filtering, only sorting (as detailed in my OP). All authors still displayed, but within each one the sorting seems arbitrary/incorrect. The issue can be seen below. Both series have sequence numbers. ![Image](https://github.com/user-attachments/assets/f57219c6-4441-4014-a764-48674bb8d634)
Author
Owner

@averageyogi commented on GitHub (Jun 6, 2025):

Sorry if I added the step to filter, but the result is the same whether you're looking at a single author or the whole library.

The ordering will be the same within an author when sorted by Author (First Last), Author (Last, First), or Added At. You can't currently sort the entire library on multiple values (there's an issue about it), so you can't usually see that the order is Added At if you're looking at the entire library. But it becomes apparent when you filter an individual author out.

As I mentioned in the corresponding reddit post, the default sort being used is usually Added At. It will fall back to this whenever the chosen sort doesn't have unique values. For this case, you sort by Author, but every item has the same author, and so falls back to Added At date for an order. I assume it's chosen as Added At because that value will always be populated when an item is added to the library, while Publish Year could be left empty.

When you expand series, you're saying you want to see individual books, not series, so the sequence numbers are dropped with that view. With series collapsed, this issue is not as apparent of a problem in the Library view as the ordered series entries won't be visible (other titles are still sorted by Added At). When you click on a collapsed series, it will bring you to the Series view page instead, which will always show sequence numbers if they exist.

@averageyogi commented on GitHub (Jun 6, 2025): Sorry if I added the step to filter, but the result is the same whether you're looking at a single author or the whole library. <img src="https://github.com/user-attachments/assets/dfe9b407-fab2-40c1-b460-564083355b18" width="700"> The ordering will be the same within an author when sorted by Author (First Last), Author (Last, First), or Added At. You can't currently sort the entire library on multiple values (there's an issue about it), so you can't usually see that the order is Added At if you're looking at the entire library. But it becomes apparent when you filter an individual author out. <img src="https://github.com/user-attachments/assets/84d58a2c-3c65-4fa7-8c8d-e10d1a261b22" width="700"> <img src="https://github.com/user-attachments/assets/d364a9d2-0d9c-46ad-9136-98f58e2b861e" width="700"> <img src="https://github.com/user-attachments/assets/ba4ccb83-adfc-44fe-b017-a09a740b813d" width="700"> As I mentioned in the corresponding reddit post, the default sort being used is usually Added At. It will fall back to this whenever the chosen sort doesn't have unique values. For this case, you sort by Author, but every item has the same author, and so falls back to Added At date for an order. I assume it's chosen as Added At because that value will always be populated when an item is added to the library, while Publish Year could be left empty. When you expand series, you're saying you want to see individual books, not series, so the sequence numbers are dropped with that view. With series collapsed, this issue is not as apparent of a problem in the Library view as the ordered series entries won't be visible (other titles are still sorted by Added At). When you click on a collapsed series, it will bring you to the Series view page instead, which will always show sequence numbers if they exist. <img src="https://github.com/user-attachments/assets/c403ddc1-0b3e-46ce-951f-61a3d5377ecb" width="700"> <img src="https://github.com/user-attachments/assets/c1c46919-0609-437a-8c57-4dbe424ae1e7" width="700">
Author
Owner

@RChesterton commented on GitHub (Jun 6, 2025):

I would have thought Title would be a more logical secondary sort order and should also always be populated?

If it's by design, it's odd but OK.

Looking into this more, I have seen a few comments along the lines of "yeah sort order is weird and random, but it is what it is for now".

@RChesterton commented on GitHub (Jun 6, 2025): I would have thought Title would be a more logical secondary sort order and should also always be populated? If it's by design, it's odd but OK. Looking into this more, I have seen a few comments along the lines of "yeah sort order is weird and random, but it is what it is for now".
Author
Owner

@kishansinghifs1 commented on GitHub (Jun 8, 2025):

Can I work on this.

@kishansinghifs1 commented on GitHub (Jun 8, 2025): Can I work on this.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 15, 2025):

Fixed in v2.25.1.

@github-actions[bot] commented on GitHub (Jun 15, 2025): Fixed in [v2.25.1](https://github.com/advplyr/audiobookshelf/releases/tag/v2.25.1).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2829