[Bug]: ABS transfers literal \ns from Audible to chapter titles in metadata.json breaking things. #2623

Closed
opened 2026-04-25 00:09:05 +02:00 by adam · 1 comment
Owner

Originally created by @iconoclasthero on GitHub (Feb 27, 2025).

What happened?

I went to reindex Josephus's The Antiquities of the Jews and when I finished, there were a shitload of chapters that were all in one chapter at the end. Investigation showed that there were more chapters than chapter start times because there were literal \ns embedded in some (though not nearly all) of the chapters. It starts here:

      "id": 156,
      "title": "Chapter 2 - How Upon The Death Of Cyrus The Jews Were Hindered In\nBuilding Of The 
Temple By The Cutheans, And The Neighboring Governors;\nAnd How Cambyses Entirely Forbade The Jews To 
Do Any Such Thing",
      "start": 96140.984,
      "end": 96410.289
    },

I'm not sure how to figure out how many of them there are other than by comparing the number of chapter lines vs. chapter start times:

$ printf %s\\n "${chap_titles[@]}"|wc -l; printf %s\\n "${chap_starts[@]}" |wc -l
348
280

(see: https://github.com/iconoclasthero/indexopus/blob/master/indexopus#L222)

This has downstream effects on ABS displaying the chapters properly...

What did you expect to happen?

ABS should strip literal \ns from the chapter titles? Anyway, I don't want them in the .json file.

Steps to reproduce the issue

  1. see above.

Audiobookshelf version

2.19.4

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


Additional Notes

No response

Originally created by @iconoclasthero on GitHub (Feb 27, 2025). ### What happened? I went to reindex Josephus's _The Antiquities of the Jews_ and when I finished, there were a shitload of chapters that were all in one chapter at the end. Investigation showed that there were more chapters than chapter start times because there were literal `\n`s embedded in some (though not nearly all) of the chapters. It starts here: ``` "id": 156, "title": "Chapter 2 - How Upon The Death Of Cyrus The Jews Were Hindered In\nBuilding Of The Temple By The Cutheans, And The Neighboring Governors;\nAnd How Cambyses Entirely Forbade The Jews To Do Any Such Thing", "start": 96140.984, "end": 96410.289 }, ``` I'm not sure how to figure out how many of them there are other than by comparing the number of chapter lines vs. chapter start times: ``` $ printf %s\\n "${chap_titles[@]}"|wc -l; printf %s\\n "${chap_starts[@]}" |wc -l 348 280 ``` (see: https://github.com/iconoclasthero/indexopus/blob/master/indexopus#L222) This has downstream effects on ABS displaying the chapters properly... ### What did you expect to happen? ABS should strip literal `\n`s from the chapter titles? Anyway, I don't want them in the .json file. ### Steps to reproduce the issue 1. see above. ### Audiobookshelf version 2.19.4 ### 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 ```shell ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:09:05 +02:00
adam closed this issue 2026-04-25 00:09:05 +02:00
Author
Owner

@iconoclasthero commented on GitHub (Feb 27, 2025):

In looking at this again, it looks like ABS itself is correctly processing the chapter titles and the times... I was off because the player was not at 1x and the times were adjusted accordingly.

However, it doesn't seem like a great idea to leave the \ns in the chapter titles in the metadata.json file.

Dispose of this ticket as you wish...

@iconoclasthero commented on GitHub (Feb 27, 2025): In looking at this again, it looks like ABS itself is correctly processing the chapter titles and the times... I was off because the player was not at 1x and the times were adjusted accordingly. However, it doesn't seem like a great idea to leave the `\n`s in the chapter titles in the metadata.json file. Dispose of this ticket as you wish...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2623