[PR #4975] Fix series name case-sensitivity when editing books #4389

Open
opened 2026-04-25 00:19:34 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4975
Author: @rbennion
Created: 1/9/2026
Status: 🔄 Open

Base: masterHead: fix/series-case-sensitivity


📝 Commits (1)

  • 792588c Fix series name case-sensitivity when editing books

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 server/models/Book.js (+8 -0)

📄 Description

Brief summary

Allow users to correct series name casing without workarounds. When editing a book's series name with different casing (e.g., "example series" → "Example Series"), the change now persists after saving.

Which issue is fixed?

Fixes #4934

In-depth Description

The bug was in server/models/Book.js in the updateSeriesFromRequest method. When updating a book's series:

  1. The code finds existing series using case-insensitive matching (se.name.toLowerCase() === seriesObj.name.toLowerCase())
  2. If found, it previously only updated the sequence - never the series name casing

Now, when the casing differs, the code updates the series name in the database:

// Update series name if casing differs (e.g., "example series" -> "Example Series")
if (existingSeries.name !== seriesObj.name) {
  existingSeries.name = seriesObj.name
  existingSeries.nameIgnorePrefix = getTitleIgnorePrefix(seriesObj.name)
  await existingSeries.save()
  hasUpdates = true
  Logger.debug(`[Book] "${this.title}" Updated series name casing to "${seriesObj.name}"`)
}

This affects the canonical series name in the database, so all books using that series will reflect the corrected casing - which matches user expectations.

How have you tested this?

  1. All 315 existing unit tests pass
  2. Manual testing steps:
    • Import a book with series "example series"
    • Edit the book and change series to "Example Series"
    • Save the changes
    • Reopen the book - the series now shows "Example Series" (previously reverted)

🤖 Generated with Claude Code


🔄 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/4975 **Author:** [@rbennion](https://github.com/rbennion) **Created:** 1/9/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/series-case-sensitivity` --- ### 📝 Commits (1) - [`792588c`](https://github.com/advplyr/audiobookshelf/commit/792588c95ebc518211adf2e1340ab0e95824580b) Fix series name case-sensitivity when editing books ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/models/Book.js` (+8 -0) </details> ### 📄 Description ## Brief summary Allow users to correct series name casing without workarounds. When editing a book's series name with different casing (e.g., "example series" → "Example Series"), the change now persists after saving. ## Which issue is fixed? Fixes #4934 ## In-depth Description The bug was in `server/models/Book.js` in the `updateSeriesFromRequest` method. When updating a book's series: 1. The code finds existing series using case-insensitive matching (`se.name.toLowerCase() === seriesObj.name.toLowerCase()`) 2. If found, it previously **only updated the sequence** - never the series name casing Now, when the casing differs, the code updates the series name in the database: ```javascript // Update series name if casing differs (e.g., "example series" -> "Example Series") if (existingSeries.name !== seriesObj.name) { existingSeries.name = seriesObj.name existingSeries.nameIgnorePrefix = getTitleIgnorePrefix(seriesObj.name) await existingSeries.save() hasUpdates = true Logger.debug(`[Book] "${this.title}" Updated series name casing to "${seriesObj.name}"`) } ``` This affects the canonical series name in the database, so all books using that series will reflect the corrected casing - which matches user expectations. ## How have you tested this? 1. All 315 existing unit tests pass 2. Manual testing steps: - Import a book with series "example series" - Edit the book and change series to "Example Series" - Save the changes - Reopen the book - the series now shows "Example Series" (previously reverted) 🤖 Generated with [Claude Code](https://claude.ai/code) --- <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:19:34 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4389