[Bug]: duration column of books table not updated if null but audio files exist #935

Open
opened 2025-10-14 18:05:47 -06:00 by navan · 0 comments
Owner

Originally created by @nichwall on 12/2/2024

What happened?

A record is able to have NULL in the duration column of the books table. I have a number of books originally added before the migration to SQLite in 2.3.x where the duration is NULL. The duration is shown correctly in the web client, and the duration for each file is included in the audioFiles column, which I assume is what is being used for the API.

When I manually scan the book individually, using "Re-Scan" in the edit modal, the duration column is correctly updated to have a numeric value instead of NULL. When scanning the entire library, the duration column is not updated and remains NULL.

What did you expect to happen?

duration column to be updated when performing a full library scan. This may be due to the book already being "up-to-date", so the duration column is not updated.

Steps to reproduce the issue

  1. Have a book from an old database where the duration column is NULL or a value that is easy to see the data change
  2. Scan library
  3. Observe duration column is not updated
  4. Scan individual book
  5. Observe duration column updated

Audiobookshelf version

v2.17.2

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?

None

Logs

No response

Additional Notes

No response

*Originally created by @nichwall on 12/2/2024* ### What happened? A record is able to have `NULL` in the `duration` column of the `books` table. I have a number of books originally added before the migration to SQLite in `2.3.x` where the `duration` is NULL. The duration is shown correctly in the web client, and the duration for each file is included in the `audioFiles` column, which I assume is what is being used for the API. When I manually scan the book individually, using "Re-Scan" in the edit modal, the duration column is correctly updated to have a numeric value instead of `NULL`. When scanning the entire library, the duration column is not updated and remains `NULL`. ### What did you expect to happen? `duration` column to be updated when performing a full library scan. This may be due to the book already being "up-to-date", so the `duration` column is not updated. ### Steps to reproduce the issue 1. Have a book from an old database where the `duration` column is NULL or a value that is easy to see the data change 2. Scan library 3. Observe `duration` column is not updated 4. Scan individual book 5. Observe `duration` column updated ### Audiobookshelf version v2.17.2 ### 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? None ### Logs _No response_ ### Additional Notes _No response_
Sign in to join this conversation.
No labels
authentication
awaiting release
awaiting release
awaiting release
awaiting release
backlog
backlog
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
bug
chapter editor
chapter editor
chapter editor
chapter editor
chapter editor
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
ebooks
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
enhancement
possible plugin
progress sync
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
sorting/filtering/searching
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
unable to reproduce
upload
users & permissions
users & permissions
users & permissions
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
waiting
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: github/audiobookshelf#935
No description provided.