Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Chapters are wrong when a book consists of multiple .m4b files #857

Closed
abstrakct opened this issue Jul 24, 2022 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@abstrakct
Copy link

Describe the issue

I have some audiobooks that consists of two .m4b files. Each file contains many chapters. Audiobookshelf detects and scans them correctly, but in the chapter list for the book (in audiobookshelf) the first chapter of file 2 is missing. When playing the book in audiobookshelf, all chapters from file 1 are correct, but the first chapter of file 2 has the name of the second chapter in file 2.

Screenshots probably explain it better:

File 2 metadata:
2022-07-24-13-10-01

But in audiobookshelf:
2022-07-24-13-11-24

As you can see, "Chapter 30 - Beyond the Oak" is missing in audiobookshelf -- but if I play the book and skip to what audiobookshelf thinks is "Chapter 31 - Assurances" it starts playing at the beginning of file 2, at "Chapter 30 - Beyond the Oak". And all subsequent chapter indexes are now wrong.

I haven't looked at any code, but I suspect an "off-by-1" type of error somewhere, since playing starts at the beginning of the file, but uses chapter metadata starting at the second chapter (in file 2).

Apart from this issue audiobookshelf appears to parse/scan the .m4b files correctly, thus it appears to be a bug in audiobookshelf.

No errors in the logs, even on Debug log level.

Books consisting of only one .m4b file has no chapter issues.

Steps to reproduce the issue

  1. Add an audiobook in .m4b format, with at least two tracks. Each track must probably contain more than one chapter and metadata about the chapters.
  2. Observe that the first chapter of the second track isn't listed in audiobookshelf
  3. Observe that playing the book starting at the first chapter in the second file will start playing at the beginning of the file, but the chapter metadata is wrong. Skipping to next chapter goes to the wrong timestamp.

Audiobookshelf version

v2.1.0

How are you running audiobookshelf?

Docker

@abstrakct abstrakct added the bug Something isn't working label Jul 24, 2022
@advplyr
Copy link
Owner

advplyr commented Jul 24, 2022

Can you share the full chapters of both files then the full chapters that audiobookshelf parsed?

The way abs handles merging chapters between multiple files may be the reason for this but I need all the data.

@advplyr advplyr added the waiting Waiting for OP label Jul 24, 2022
@abstrakct
Copy link
Author

Sure, from mediainfo:

file 1:
2022-07-27-19-50-34

file 2:
2022-07-27-19-51-07

And in ABS:

2022-07-27-19-55-53

2022-07-27-19-56-25

@advplyr
Copy link
Owner

advplyr commented Jul 30, 2022

Fixed in v2.1.1

It was checking if there was already a chapter with the same start time and ignoring it. This was causing the 0:00 start time in the second book to get ignored. Fixed now.

@advplyr advplyr closed this as completed Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants