mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-28 21:19:42 +00:00
Fix series name case-sensitivity when editing books
When editing a book's series, the code now updates the series name if the casing differs from what's stored in the database. Previously, the series name would revert to its original casing after saving. Fixes #4934 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
122fc34a75
commit
792588c95e
1 changed files with 8 additions and 0 deletions
|
|
@ -518,6 +518,14 @@ class Book extends Model {
|
|||
|
||||
const existingSeries = this.series.find((se) => se.name.toLowerCase() === seriesObj.name.toLowerCase())
|
||||
if (existingSeries) {
|
||||
// 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}"`)
|
||||
}
|
||||
if (existingSeries.bookSeries.sequence !== seriesObjSequence) {
|
||||
existingSeries.bookSeries.sequence = seriesObjSequence
|
||||
await existingSeries.bookSeries.save()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue