[PR #1076] [CLOSED] Fix:Unescaped characters in description causing issues with m4b merging #3442

Closed
opened 2026-04-25 00:15:40 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/1076
Author: @conumey
Created: 10/18/2022
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • e41a904 Fix:Unescaped characters in description causing issues with m4b merging

📊 Changes

3 files changed (+68 additions, -1 deletions)

View changed files

📝 server/managers/AbMergeManager.js (+1 -1)
server/utils/stringEscaper.js (+5 -0)
📝 server/utils/toneHelpers.js (+62 -0)

📄 Description

When the merge tags the merged file, and the metadata contains an unescaped double quote (or potentially only when it is the first character), it causes the merge to fail, and potentially other issues if the tagging action happens to succeed anyway.

Here's a nice error where the description after the initial quoted text gets added to the filepath:
image

This happened with a few other merges that completed "succesfully":
image

Escaping the characters may have stopped this Missing Parts problem happening as well, though I'm not certain as it doesn't consistently happen when they're unescaped.

My fix is a bit of a lazy one in that I just duplicated the getToneMetadataObject function, as escaping by default meant that the descriptions in the library were full of backslashes and I didn't fancy rewriting the frontend to render escaped characters normally 😇


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/1076 **Author:** [@conumey](https://github.com/conumey) **Created:** 10/18/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`e41a904`](https://github.com/advplyr/audiobookshelf/commit/e41a90463b64b479169b65f50d95a7c962424f5d) Fix:Unescaped characters in description causing issues with m4b merging ### 📊 Changes **3 files changed** (+68 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/AbMergeManager.js` (+1 -1) ➕ `server/utils/stringEscaper.js` (+5 -0) 📝 `server/utils/toneHelpers.js` (+62 -0) </details> ### 📄 Description When the merge tags the merged file, and the metadata contains an unescaped double quote (or potentially only when it is the first character), it causes the merge to fail, and potentially other issues if the tagging action happens to succeed anyway. Here's a nice error where the description after the initial quoted text gets added to the filepath: ![image](https://user-images.githubusercontent.com/9056681/196329481-c2e5aac2-63ec-4856-bf42-70a7a8c6660f.png) This happened with a few other merges that completed "succesfully": ![image](https://user-images.githubusercontent.com/9056681/196329531-fc91d4df-0c4a-47bd-95bf-5be09f3518ca.png) Escaping the characters may have stopped this Missing Parts problem happening as well, though I'm not certain as it doesn't consistently happen when they're unescaped. My fix is a bit of a lazy one in that I just duplicated the getToneMetadataObject function, as escaping by default meant that the descriptions in the library were full of backslashes and I didn't fancy rewriting the frontend to render escaped characters normally 😇 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:15:40 +02:00
adam closed this issue 2026-04-25 00:15:40 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3442