Chapters are only shown from first track in books with multiple tracks #721

Closed
opened 2026-04-24 23:18:15 +02:00 by adam · 9 comments
Owner

Originally created by @theswordsmahin on GitHub (Oct 27, 2022).

Steps to reproduce

  1. Open a book that contains multiple m4b tracks, each with multiple chapters (Graphic Audio books, for example)
  2. Select the chapter button from within the app.

Expected behaviour

Chapters from each track should be shown, by track order, then chapter order

Actual behaviour

Only chapters from the first track are displayed, but the book runtime appears to be correct, and the book seems to play correctly. The chapter selection just becomes useless.

Environment data

Audiobookshelf Version:

  • Android App?
  • iOS App?
Originally created by @theswordsmahin on GitHub (Oct 27, 2022). ### Steps to reproduce 1. Open a book that contains multiple m4b tracks, each with multiple chapters (Graphic Audio books, for example) 2. Select the chapter button from within the app. ### Expected behaviour Chapters from each track should be shown, by track order, then chapter order ### Actual behaviour Only chapters from the first track are displayed, but the book runtime appears to be correct, and the book seems to play correctly. The chapter selection just becomes useless. ### Environment data Audiobookshelf Version: - [x] Android App? - [ ] iOS App?
adam added the bug label 2026-04-24 23:18:16 +02:00
adam closed this issue 2026-04-24 23:18:17 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 27, 2022):

For Graphic Audio books they have them separated into multiple m4bs each with different chapters?

At one point I had it setup to attempt to merge chapters but this became problematic since the first chapter will always be saved as being at position 0s. I had it calculating the offset of each first chapter to make up for that but then in some instances the same chapters are put into each audio file.
Now we have to find a way to check if the chapters are the same and not merge.

Are there free graphic audio audiobooks available that I can get to test this?

@advplyr commented on GitHub (Oct 27, 2022): For Graphic Audio books they have them separated into multiple m4bs each with different chapters? At one point I had it setup to attempt to merge chapters but this became problematic since the first chapter will always be saved as being at position 0s. I had it calculating the offset of each first chapter to make up for that but then in some instances the same chapters are put into each audio file. Now we have to find a way to check if the chapters are the same and not merge. Are there free graphic audio audiobooks available that I can get to test this?
Author
Owner

@longca2 commented on GitHub (Nov 1, 2022):

This public domain version of Don Quixote provides an example of the issue:

https://archive.org/details/don_quixote_vol1_librivox

The "Chapters" tab will populate up to Audio Track 7, Book Chapter 13. This is the end of the Part 1 m4b. My particular instance of this was using the WebApp.

image

@longca2 commented on GitHub (Nov 1, 2022): This public domain version of Don Quixote provides an example of the issue: https://archive.org/details/don_quixote_vol1_librivox The "Chapters" tab will populate up to Audio Track 7, Book Chapter 13. This is the end of the Part 1 m4b. My particular instance of this was using the WebApp. ![image](https://user-images.githubusercontent.com/8688679/199303146-30ba32bd-337b-4a3f-9b7d-5acb14efc6b3.png)
Author
Owner

@theswordsmahin commented on GitHub (Nov 2, 2022):

@longca2 thank you for providing that free example
@advplyr Sorry for the delay and looking into the issue - it does sound tricky. If/when you have any nightly docker image builds available I can help test them out on my library.

@theswordsmahin commented on GitHub (Nov 2, 2022): @longca2 thank you for providing that free example @advplyr Sorry for the delay and looking into the issue - it does sound tricky. If/when you have any nightly docker image builds available I can help test them out on my library.
Author
Owner

@advplyr commented on GitHub (Nov 2, 2022):

Thanks for that example audiobook. Abs is getting those chapters from the first M4b. I'll need to think of the best way to handle this since the last attempt at merging chapters caused some issues.

For reference, here is that audiobook first m4b chapters:
image

and here is the second m4b file:
image

The best way will probably be to compare the chapter titles for each audio file and if they are different then do a merge

@advplyr commented on GitHub (Nov 2, 2022): Thanks for that example audiobook. Abs is getting those chapters from the first M4b. I'll need to think of the best way to handle this since the last attempt at merging chapters caused some issues. For reference, here is that audiobook first m4b chapters: ![image](https://user-images.githubusercontent.com/67830747/199611848-b2bb416c-dafd-434d-9c46-206f4557356c.png) and here is the second m4b file: ![image](https://user-images.githubusercontent.com/67830747/199611809-a73b651e-644c-4cb0-8e4c-da024bed56f6.png) The best way will probably be to compare the chapter titles for each audio file and if they are different then do a merge
Author
Owner

@dasfuu commented on GitHub (Jan 19, 2023):

I have the same issue with multiple audiobooks. (e.g. https://www.urbanaudiobooks.com/avatar-the-last-airbender-the-rise-of-kyoshi?sp=362134)
Chapter names a different in all parts too.

@dasfuu commented on GitHub (Jan 19, 2023): I have the same issue with multiple audiobooks. (e.g. https://www.urbanaudiobooks.com/avatar-the-last-airbender-the-rise-of-kyoshi?sp=362134) Chapter names a different in all parts too.
Author
Owner

@advplyr commented on GitHub (Feb 1, 2023):

Updated in v2.2.13

@advplyr commented on GitHub (Feb 1, 2023): Updated in [v2.2.13](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.13)
Author
Owner

@RobinD42 commented on GitHub (Feb 2, 2023):

I expected that a Scan or Forced Re-scan would pick up the additional chapters from the M4Bs after the first one, but it seems it doesn't do it until I remove and then re-add the book's folder. Is that intended?

@RobinD42 commented on GitHub (Feb 2, 2023): I expected that a Scan or Forced Re-scan would pick up the additional chapters from the M4Bs after the first one, but it seems it doesn't do it until I remove and then re-add the book's folder. Is that intended?
Author
Owner

@dasfuu commented on GitHub (Feb 2, 2023):

A rescan on the books worked for me at least.

@dasfuu commented on GitHub (Feb 2, 2023): A rescan on the books worked for me at least.
Author
Owner

@advplyr commented on GitHub (Feb 2, 2023):

I wouldn't say it is intended, but more of a side-effect of how it was built. If any changes to the audio tracks are detected it will trigger a function that will update chapter data. If there are no changes to the audio tracks then it will not re-set chapter data.

We should be able to improve all this

@advplyr commented on GitHub (Feb 2, 2023): I wouldn't say it is intended, but more of a side-effect of how it was built. If any changes to the audio tracks are detected it will trigger a function that will update chapter data. If there are no changes to the audio tracks then it will not re-set chapter data. We should be able to improve all this
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#721