[Bug]: Wrong sorting of files #1037

Closed
opened 2026-04-24 23:29:37 +02:00 by adam · 4 comments
Owner

Originally created by @BastLeblanc on GitHub (Mar 23, 2023).

Describe the issue

I have an audiobook with these files:

01 - Disc 1a - Tess Gerritsen.mp3
02 - Disc 1b - Tess Gerritsen.mp3
03 - Disc 1c - Tess Gerritsen.mp3
04 - Disc 1d - Tess Gerritsen.mp3
05 - Disc 1e - Tess Gerritsen.mp3
06 - Disc 1f - Tess Gerritsen.mp3
07 - Disc 1g - Tess Gerritsen.mp3
08 - Disc 1h - Tess Gerritsen.mp3
09 - Disc 1i - Tess Gerritsen.mp3
10 - Disc 1j - Tess Gerritsen.mp3
21 - Disc 2a - Tess Gerritsen.mp3
22 - Disc 2b - Tess Gerritsen.mp3
23 - Disc 2c - Tess Gerritsen.mp3
24 - Disc 2d - Tess Gerritsen.mp3
[..]

But on audiobookshelf they are sorted like this:

1 | 01 - Disc 1a - Tess Gerritsen.mp3 | 6.39 MB | 6:58 | download
2 | 21 - Disc 2a - Tess Gerritsen.mp3 | 5.72 MB | 6:14 | download
3 | 31 - Disc 3a - Tess Gerritsen.mp3 | 5.75 MB | 6:16 | download
4 | 41 - Disc 4a - Tess Gerritsen.mp3 | 5.56 MB | 6:04 | download
5 | 51 - Disc 5a - Tess Gerritsen.mp3 | 5.57 MB | 6:05 | download
6 | 02 - Disc 1b - Tess Gerritsen.mp3 | 5.37 MB | 5:51 | download
7 | 22 - Disc 2b - Tess Gerritsen.mp3 | 5.55 MB | 6:03 | download
[...]

Steps to reproduce the issue

have files named like this
01 - Disc 1a - Tess Gerritsen.mp3
02 - Disc 1b - Tess Gerritsen.mp3
03 - Disc 1c - Tess Gerritsen.mp3
04 - Disc 1d - Tess Gerritsen.mp3
05 - Disc 1e - Tess Gerritsen.mp3
06 - Disc 1f - Tess Gerritsen.mp3
07 - Disc 1g - Tess Gerritsen.mp3
08 - Disc 1h - Tess Gerritsen.mp3
09 - Disc 1i - Tess Gerritsen.mp3
10 - Disc 1j - Tess Gerritsen.mp3
21 - Disc 2a - Tess Gerritsen.mp3

Audiobookshelf version

v2.2.15

How are you running audiobookshelf?

Docker

Originally created by @BastLeblanc on GitHub (Mar 23, 2023). ### Describe the issue I have an audiobook with these files: ``` 01 - Disc 1a - Tess Gerritsen.mp3 02 - Disc 1b - Tess Gerritsen.mp3 03 - Disc 1c - Tess Gerritsen.mp3 04 - Disc 1d - Tess Gerritsen.mp3 05 - Disc 1e - Tess Gerritsen.mp3 06 - Disc 1f - Tess Gerritsen.mp3 07 - Disc 1g - Tess Gerritsen.mp3 08 - Disc 1h - Tess Gerritsen.mp3 09 - Disc 1i - Tess Gerritsen.mp3 10 - Disc 1j - Tess Gerritsen.mp3 21 - Disc 2a - Tess Gerritsen.mp3 22 - Disc 2b - Tess Gerritsen.mp3 23 - Disc 2c - Tess Gerritsen.mp3 24 - Disc 2d - Tess Gerritsen.mp3 [..] ``` But on audiobookshelf they are sorted like this: ``` 1 | 01 - Disc 1a - Tess Gerritsen.mp3 | 6.39 MB | 6:58 | download 2 | 21 - Disc 2a - Tess Gerritsen.mp3 | 5.72 MB | 6:14 | download 3 | 31 - Disc 3a - Tess Gerritsen.mp3 | 5.75 MB | 6:16 | download 4 | 41 - Disc 4a - Tess Gerritsen.mp3 | 5.56 MB | 6:04 | download 5 | 51 - Disc 5a - Tess Gerritsen.mp3 | 5.57 MB | 6:05 | download 6 | 02 - Disc 1b - Tess Gerritsen.mp3 | 5.37 MB | 5:51 | download 7 | 22 - Disc 2b - Tess Gerritsen.mp3 | 5.55 MB | 6:03 | download [...] ``` ### Steps to reproduce the issue have files named like this 01 - Disc 1a - Tess Gerritsen.mp3 02 - Disc 1b - Tess Gerritsen.mp3 03 - Disc 1c - Tess Gerritsen.mp3 04 - Disc 1d - Tess Gerritsen.mp3 05 - Disc 1e - Tess Gerritsen.mp3 06 - Disc 1f - Tess Gerritsen.mp3 07 - Disc 1g - Tess Gerritsen.mp3 08 - Disc 1h - Tess Gerritsen.mp3 09 - Disc 1i - Tess Gerritsen.mp3 10 - Disc 1j - Tess Gerritsen.mp3 21 - Disc 2a - Tess Gerritsen.mp3 ### Audiobookshelf version v2.2.15 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:29:37 +02:00
adam closed this issue 2026-04-24 23:29:37 +02:00
Author
Owner

@BastLeblanc commented on GitHub (Mar 23, 2023):

I guess it's a mixup between metadata and filename

I realise there's a solution in the tool itself:

  • go the book
  • click Manage Tracks
  • click on the filename header to sort by filename
  • click save tracklist

so maybe it's not a bug, more a badly presented metadata

@BastLeblanc commented on GitHub (Mar 23, 2023): I guess it's a mixup between metadata and filename I realise there's a solution in the tool itself: - go the book - click Manage Tracks - click on the filename header to sort by filename - click save tracklist so maybe it's not a bug, more a badly presented metadata
Author
Owner

@hobesman commented on GitHub (Mar 23, 2023):

Yeah I'm guessing it's sorting by the embedded track number at first. So if you have multiple track 1, it's putting those first.

By chance did you also have the disc number set in the embedded tags? If so and it's ignoring that and sorting by track number alone, then that might be a legitimate bug/feature request.

@hobesman commented on GitHub (Mar 23, 2023): Yeah I'm guessing it's sorting by the embedded track number at first. So if you have multiple track 1, it's putting those first. By chance did you also have the disc number set in the embedded tags? If so and it's ignoring that and sorting by track number alone, then that might be a legitimate bug/feature request.
Author
Owner

@BastLeblanc commented on GitHub (Mar 23, 2023):

These mp3 didn't have disc nbr in their tags, so it ordered all the tracknbr 1 first.

Maybe it could be smart about multiple same track numbers in one book? with an alert or with a tentative to reconcile with the filename?

@BastLeblanc commented on GitHub (Mar 23, 2023): These mp3 didn't have disc nbr in their tags, so it ordered all the tracknbr 1 first. Maybe it could be smart about multiple same track numbers in one book? with an alert or with a tentative to reconcile with the filename?
Author
Owner

@advplyr commented on GitHub (Mar 31, 2023):

The disc number set in the filename would have worked if it was only numbers.
You can open up a feature request if you have ideas for a smarter track ordering system.

@advplyr commented on GitHub (Mar 31, 2023): The disc number set in the filename would have worked if it was only numbers. You can open up a feature request if you have ideas for a smarter track ordering system.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1037