[Bug]: Library Files listed in wrong order after renaming files (similar to issue #517) #878

Open
opened 2026-04-24 23:24:54 +02:00 by adam · 6 comments
Owner

Originally created by @kenw on GitHub (Jan 9, 2023).

Describe the issue

After renaming some library files and doing a re-scan, the listed audio file order was not re-sorted alpha-numerically.

Audiobookshelf seemed to preserve the original sort order (before files were renamed).

Issue is very similar to #517

image

image

Steps to reproduce the issue

  1. Rename a book's audio file so that the sort order would change (ex. rename "5.mp3" to "99.mp3")
  2. Re-scan book

Audiobookshelf version

v2.2.12

How are you running audiobookshelf?

Docker

Originally created by @kenw on GitHub (Jan 9, 2023). ### Describe the issue After renaming some library files and doing a re-scan, the listed audio file order was not re-sorted alpha-numerically. Audiobookshelf seemed to preserve the original sort order (before files were renamed). Issue is very similar to #517 ![image](https://user-images.githubusercontent.com/161240/211417088-f2789aef-4792-48c1-beb8-26d87392a6b0.png) ![image](https://user-images.githubusercontent.com/161240/211417219-e4f177f9-cb3d-42ca-a490-105276895b75.png) ### Steps to reproduce the issue 1. Rename a book's audio file so that the sort order would change (ex. rename "5.mp3" to "99.mp3") 2. Re-scan book ### Audiobookshelf version v2.2.12 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:24:54 +02:00
Author
Owner

@advplyr commented on GitHub (Jan 9, 2023):

Go to the "Manage Tracks" page and take a screenshot of what you see there.
Abs will prefer using the track number found from the audio file metadata if it exists.

Also, if you have previously manually updated the track order and pressed saved then the order you set will not be overridden

@advplyr commented on GitHub (Jan 9, 2023): Go to the "Manage Tracks" page and take a screenshot of what you see there. Abs will prefer using the track number found from the audio file metadata if it exists. Also, if you have previously manually updated the track order and pressed saved then the order you set will not be overridden
Author
Owner

@kenw commented on GitHub (Jan 9, 2023):

Go to the "Manage Tracks" page and take a screenshot of what you see there. Abs will prefer using the track number found from the audio file metadata if it exists.

Also, if you have previously manually updated the track order and pressed saved then the order you set will not be overridden

Here is a screenshot (NOTE: I had to recreate the issue by renaming "5.mp3" to "99-5.mp3")

EDIT: I did not previously manually update the track order
EDIT 2: Apologies! Please ignore this screenshot. I forgot I had added the TRACK # metadata information. I will provide new screenshots in the following comment

image

@kenw commented on GitHub (Jan 9, 2023): > Go to the "Manage Tracks" page and take a screenshot of what you see there. Abs will prefer using the track number found from the audio file metadata if it exists. > > Also, if you have previously manually updated the track order and pressed saved then the order you set will not be overridden Here is a screenshot (NOTE: I had to recreate the issue by renaming "5.mp3" to "99-5.mp3") EDIT: I did not previously manually update the track order EDIT 2: **Apologies**! Please ignore this screenshot. I forgot I had added the TRACK # metadata information. I will provide new screenshots in the following comment ![image](https://user-images.githubusercontent.com/161240/211421671-d6a1fc53-a44c-4b45-afe6-0dca9633063d.png)
Author
Owner

@kenw commented on GitHub (Jan 10, 2023):

Here is a new set of screenshots (after I renamed audio files and re-scanned the audiobook):

image

image

image

@kenw commented on GitHub (Jan 10, 2023): Here is a new set of screenshots (after I renamed audio files and re-scanned the audiobook): ![image](https://user-images.githubusercontent.com/161240/211425693-869e49a0-259e-4565-a48d-7759dab6a7e7.png) ![image](https://user-images.githubusercontent.com/161240/211425778-1e309ef8-7c16-4ca9-b2c2-7a6b876eda31.png) ![image](https://user-images.githubusercontent.com/161240/211425900-60e615fc-61e9-420c-b15c-4769a0717da2.png)
Author
Owner

@yuuzhan commented on GitHub (Jun 10, 2023):

I have noticed this as well. There are two ways you can over come it.

I believe the root cause is that in the files metadata the Track Number is what the sorter order is. If you change the Track Number in the metadata it should re-organize it on a re-scan.
image

The other way I was able to overcome this is to rename it to something like "Track-##" or "someLongString-##". That seemed to trick the app into ignoring the track number.

@yuuzhan commented on GitHub (Jun 10, 2023): I have noticed this as well. There are two ways you can over come it. I believe the root cause is that in the files metadata the Track Number is what the sorter order is. If you change the Track Number in the metadata it should re-organize it on a re-scan. ![image](https://github.com/advplyr/audiobookshelf/assets/4114975/8c16b6bb-afc6-4019-9a78-98053d404113) The other way I was able to overcome this is to rename it to something like "Track-##" or "someLongString-##". That seemed to trick the app into ignoring the track number.
Author
Owner

@ObeyYourMaster commented on GitHub (Jul 13, 2025):

This is still an issue.
I have renamed the files and added a disc number, but the order is messed up. The "Manage tracks" view shows that the track number from the file is wrongly detected:

Image

So in my opinion this still needs fixing.

(Using latest version 2.26.0)

@ObeyYourMaster commented on GitHub (Jul 13, 2025): This is still an issue. I have renamed the files and added a disc number, but the order is messed up. The "Manage tracks" view shows that the track number from the file is wrongly detected: <img width="1803" height="303" alt="Image" src="https://github.com/user-attachments/assets/27a0f833-7cc3-40fe-ada3-d4fdc261d4f2" /> So in my opinion this still needs fixing. (Using latest version 2.26.0)
Author
Owner

@advplyr commented on GitHub (Jul 14, 2025):

This is still an issue. I have renamed the files and added a disc number, but the order is messed up. The "Manage tracks" view shows that the track number from the file is wrongly detected:

Image So in my opinion this still needs fixing.

(Using latest version 2.26.0)

Are those files inside a subdirectory of the item?
Or did you rename the files after they were added?

@advplyr commented on GitHub (Jul 14, 2025): > This is still an issue. I have renamed the files and added a disc number, but the order is messed up. The "Manage tracks" view shows that the track number from the file is wrongly detected: > > <img alt="Image" width="1803" height="303" src="https://private-user-images.githubusercontent.com/36849167/465777520-27a0f833-7cc3-40fe-ada3-d4fdc261d4f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTI0NDQ5NDYsIm5iZiI6MTc1MjQ0NDY0NiwicGF0aCI6Ii8zNjg0OTE2Ny80NjU3Nzc1MjAtMjdhMGY4MzMtN2NjMy00MGZlLWFkYTMtZDRmZGMyNjFkNGYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA3MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNzEzVDIyMTA0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQwMzBiNDNjNzRmZTQ0MDg3MTU2NTQ5ZWM3ODM1MTY0NTM4ZTBjYmQ3NGYyNTQzOThhZTk5YjJkYTlmZGI2YTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YFqDNfZ9Ll4YbRvqS-foqFjFpA73o-eycoJgPJihCbI"> > So in my opinion this still needs fixing. > > (Using latest version 2.26.0) Are those files inside a subdirectory of the item? Or did you rename the files after they were added?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#878