audiobookshelf icon indicating copy to clipboard operation
audiobookshelf copied to clipboard

[Bug] Audiobook length wrong (only some books)

Open pardofelis opened this issue 1 year ago • 8 comments

Dear advplyr, dear folks who made this project possible,

first of all: Thank you for your time you put into this project.

Sadly, my library has sometimes a wrong audiobook length for some books.

Steps to reproduce - Type 1: Missing audio files

  1. I have scanned a folder containing multiple folders, each containing exactly 1 audiobook.
  2. The mp3 files in it are following always the same naming: %Author% %Album% - %Track%.mp3 [even renaming them to %Track% - %Album%.mp3 didn't help]
  3. When looking into the File Tab, there are all files visible and all audio files (e.g. 1-10) are shown as type "audio"
  4. When looking into the Chapter Tab, there is a length calculated that is way shorter than the length of all audio files and there are tracks "randomly" missing. E.g. chapter 1,2,4,5,6,7,9,10 is available, but chapters 3 and 8 are missing.
  5. This doesn't apply to every book, but in my case, I found 3 books (out of 30) that share this problem.

Ways I tried to get past this - and to add them to the library:

  • Delete the book in the library and rescan the whole library
  • Clicking the "Re-Scan" in the Edit Details Panel
  • Rename the files and Re-Scan
  • Retagging the files and Re-Scan Sadly, all of that didn't help.

Expected behaviour

  • Every audio file is added to the track list and the audiobook has the right playing length

Actual behaviour

  • Some audio files are not added and the audiobook is way shorter than the length of all audio files (because of the missing files)

Steps to reproduce - Type 2: Audiofiles with wrong length — Solved

  1. I have scanned a folder containing multiple audiobooks.
  2. The mp3 files in it are following always the same naming: %Author% %Album% - %Track%.mp3 [even renaming them to %Track% - %Album%.mp3 didn't help]
  3. When looking into the File Tab, there are all files visible and all audio files (e.g. 1-10) are shown as type "audio"
  4. When looking into the Chapter Tab, there is a length calculated that is way longer than the length of all audio files and some files show a length way more than when checking them on VLC Player, Windows Details or TagScanner. This results in my case in an audiobookt with twice the length than it actually has.
  5. This doesn't apply to every book, but in my case, I found 1 book with this problem.

Ways I tried to get past this - and to add them to the library:

  • using mp3val, I was able to repair the mp3 file.

Expected behaviour

  • Every audio file is added to the track list and the audiobook has the right playing length

Actual behaviour

  • Some audio files show an incorrect length and the audiobook is way longerthan the length of all audio files (because of the wrong times)

Environment data

Audiobookshelf Version: v2.8.0 windows

Any suggestions how to solve these inconsistences is highly appreciated. Have a nice day and thank you for your time

sincerely pardofelis

pardofelis avatar Feb 24 '24 19:02 pardofelis

The duration listed in the audio tracks column is incorrect for you?

image

advplyr avatar Feb 24 '24 20:02 advplyr

Hi advplyr, thank you for your fast reply. Yes, as for the second part (Type 2), it stated e.g. to be 5 hours in file 1 instead of 7 minutes it actually had. Meanwhile I searched around and - with the help of mp3val - found out that the audio files itself had an internal error regarding the length. After repairing them and re-scanned them, they now show the right length in the file panel. So that part seems to be solved.

Using the named tool mp3val I also checked the files of the Type 1 error. But sadly, the files didn’t show an error there. And I still cannot wait them to be shown as audio tracks.

pardofelis avatar Feb 24 '24 23:02 pardofelis

Steps to reproduce - Type 1: Missing audio files

  1. I have scanned a folder containing multiple audiobooks.

Is each book in its own folder? There can be multiple subfolders, but each book needs to be in its own directory.

So something like

Library/
  Author/
    Book1/
      Book1 files
    Book2/
      Book2 files

would work, but

Library/
  Author/
    Book1 files
    Book2 files

would not.

nichwall avatar Feb 25 '24 01:02 nichwall

Hi nichwall, thank you for your reply.

Sorry for being unclear. What I meant was:

Scanned Folder Genre1/ — Folder Author1-Audiobook1 —— Files of audiobook1 (e.g. mp3, cover.jpg, playlist.m3u, details.html) — Folder Author1-Audiobook 2 —— Files of audiobook2 — Folder Author2-Audiobook 3 —— Files of audiobook3 — Folder Author3-Audiobook 4 —— Files of audiobook1 ….

So: yes, every audiobook is in its own folder, but there are multiple folders containing audiobooks in the scanned folder.

pardofelis avatar Feb 25 '24 08:02 pardofelis

In the web client if you go to the book that has incorrect chapters and press "Edit Chapters" you can see more information about chapters.

My guess is the chapters were initially set before all the audio files were scanned in. Once the chapters are set they aren't going to be modified again when more audio files are scanned but you can go to "Edit Chapters" and map them again based on the audio tracks.

image

advplyr avatar Feb 25 '24 21:02 advplyr

Hi advplyr, attached I have taken two screenshots, one of the files page and one of the chapter page As you can see, every audiofile is present in the files tab, but in the chapters page, some of them (e.g. 2,4,7,9) are missing in the files column

files tab

2024-02-26 08_01_19-Audiobookshelf - Chromium

chapter tab

2024-02-26 08_00_41-Audiobookshelf - Chromium

pardofelis avatar Feb 26 '24 07:02 pardofelis

Hi advplyr,

I have just copied the files out of the folder, deleted all files other than audio files and loaded them into mp3diags. Afterwards I asked mp3diags to run several diagnoses. After having changed the files using that tool, I reloaded the folder.

When I looked into the logs, I found:

2024-02-26 09_19_28-Audiobookshelf - Chromium

which threw an error for every file that was already missing in the chapter tab before that step.

pardofelis avatar Feb 26 '24 08:02 pardofelis

Looks like there is an issue with those files. I would need a copy of them to determine what that issue is

advplyr avatar Feb 27 '24 22:02 advplyr

This turned out to be an issue specific to ffprobe 6.1 so I updated the binary manager to only accept 5.1 for now until we can determine if it is a bug with ffprobe.

https://github.com/advplyr/audiobookshelf/commit/d2b006b909f2b3ab2569e3929f8018aeb342fe75

advplyr avatar Mar 14 '24 21:03 advplyr

Fixed in v2.8.1

advplyr avatar Mar 16 '24 23:03 advplyr