[Bug]: Strip leading and trailing zeros from series number in metadata scanner #3269

Open
opened 2026-02-20 03:06:50 -05:00 by deekerman · 0 comments
Owner

Originally created by @saltedlolly on GitHub (Nov 12, 2025).

What happened?

I am noticing some inconsistency with the way series numbers are displayed. For numbers under 10, sometimes they have a leading zero and sometimes they don't:

Image

I think this comes from an inconistency with how they are written in the folder name or meta tags. Sometime they may have leading zero, and sometimes not:

00.5
0.5
01.5
1.5

It can also be because people want folder names to sort alphabetically for a book series, especially if there are more than 10 books:

e.g. ...
/Author Name/Series Name/Vol 08.0 - Book Title
/Author Name/Series Name/Vol 08.5 - Book Title (Novella)
/Author Name/Series Name/Vol 09.0 - Book Title
/Author Name/Series Name/Vol 10.0 - Book Title
/Author Name/Series Name/Vol 11.0 - Book Title
/Author Name/Series Name/Vol 11.5 - Book Title (Novella)
etc.

I am not sure whether this is happening in the backend server, or in the web ui.

What did you expect to happen?

The metadata scanner should strip any leading or trailing zeros from the series number as files are scanned. So the above would be converted to this:

#8 - Book Title
#8.5 - Book Title (Novella)
#9 - Book Title
#10 - Book Title
#11 - Book Title
#11.5 - Book Title (Novella)

Obviously, numbers under 1 would still have leading zero, and #0 is also allowed. These are all permitted:

#0
#0.5
#0.05
#0.6
#1
#1.5
#10
#11.5
etc.

Steps to reproduce the issue

1Import some media with following folder names:

/Vol 05.5 - Book Title
/Vol 6.5 - Book Title

Audiobookshelf version

2.30.0

How are you running audiobookshelf?

Windows Tray App

What OS is your Audiobookshelf server hosted from?

Windows

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

Other (list in "Additional Notes" box)

Logs


Additional Notes

Using Arc Browser on macOS

Originally created by @saltedlolly on GitHub (Nov 12, 2025). ### What happened? I am noticing some inconsistency with the way series numbers are displayed. For numbers under 10, sometimes they have a leading zero and sometimes they don't: <img width="873" height="321" alt="Image" src="https://github.com/user-attachments/assets/f5346e3e-c95f-44c2-92b0-afab8af6c04b" /> I think this comes from an inconistency with how they are written in the folder name or meta tags. Sometime they may have leading zero, and sometimes not: 00.5 0.5 01.5 1.5 It can also be because people want folder names to sort alphabetically for a book series, especially if there are more than 10 books: e.g. ... /Author Name/Series Name/Vol 08.0 - Book Title /Author Name/Series Name/Vol 08.5 - Book Title (Novella) /Author Name/Series Name/Vol 09.0 - Book Title /Author Name/Series Name/Vol 10.0 - Book Title /Author Name/Series Name/Vol 11.0 - Book Title /Author Name/Series Name/Vol 11.5 - Book Title (Novella) etc. I am not sure whether this is happening in the backend server, or in the web ui. ### What did you expect to happen? The metadata scanner should strip any leading or trailing zeros from the series number as files are scanned. So the above would be converted to this: <span>#</span>8 - Book Title <span>#</span>8.5 - Book Title (Novella) <span>#</span>9 - Book Title <span>#</span>10 - Book Title <span>#</span>11 - Book Title <span>#</span>11.5 - Book Title (Novella) Obviously, numbers under 1 would still have leading zero, and #0 is also allowed. These are all permitted: <span>#</span>0 <span>#</span>0.5 <span>#</span>0.05 <span>#</span>0.6 <span>#</span>1 <span>#</span>1.5 <span>#</span>10 <span>#</span>11.5 etc. ### Steps to reproduce the issue 1Import some media with following folder names: /Vol 05.5 - Book Title /Vol 6.5 - Book Title ### Audiobookshelf version 2.30.0 ### How are you running audiobookshelf? Windows Tray App ### What OS is your Audiobookshelf server hosted from? Windows ### If the issue is being seen in the UI, what browsers are you seeing the problem on? Other (list in "Additional Notes" box) ### Logs ```shell ``` ### Additional Notes Using Arc Browser on macOS
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/audiobookshelf#3269
No description provided.