mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: Duplicate audio file entries in ABS DB pointing to the same path [after using ffmpeg to clip out extraneous material] #2846
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @iconoclasthero on GitHub (Jun 17, 2025).
What happened?
I was clipping out extraneous material from an audiobook with
ffmpegusing-ssand-toto create part files and then recombining* them withffmpeg -f concatvia myindexopusscript and copying them back over the original audiobook file. This resulted in abs reporting the sum of these multiple audio file durations as the audiobook duration and showed multiple (3) copies of the audiobook at the same path.Rescanning via the edit modal didn't fix this.
After discussing on Discord, I am logging the issue with the steps I used to reproduce this as well as the log for the reproduction and how resolved.
* NB: Mentioned for completeness and not to introduce a red herring: the recombination is unnecessary, just trimming 0.001 seconds from the beginning of the book is sufficient as shown below.
What did you expect to happen?
That ABS would correct for there only being one file after rescanning regardless of the multiple inode numbers (this is an assumption I did not verify) for the audiofile in the database.
Steps to reproduce the issue
Simplified command history:
resulted in
with a total duration of:
Audiobookshelf version
v.2.24.0 -- running https://github.com/advplyr/audiobookshelf/pull/4384
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?
I use Chrome, but this is a server rather than a UI issue.
Logs
2025-06-17.txt
Additional Notes/Resolution
To fix the duplicate entries and double (or triple) duration, I moved the file to the tmpfs mount at /dev/shm/cache, gave ABS a moment to update the removal, confirmed the removal in the web UI,* then moved it back (thus clearing the inode numbers in ABS DB and giving the file a new inode number).
* This is relevant because just moving it back and forth in two subsequent commands without allowing the db to update does not resolve the problem.
2025-06-17-2.txt