Files
calibre-web/cps
TowyTowyandClaude Fable 5 77265abfcc Fix UNIQUE constraint crash on transliteration-twin authors
The custom lower() SQL function registered in cps/db.py transliterates
author names via unidecode, so the case-insensitive lookup in
prepare_authors() also matched authors whose names are genuinely
different but collapse to the same ASCII string (accented vs. plain
Latin names, or Chinese homophones). The code then renamed that matched
author onto the freshly entered name, overwriting a distinct existing
author row and raising:

    (sqlite3.IntegrityError) UNIQUE constraint failed: authors.name

Restrict the case-rename branch to matches that are equal ignoring case
only (casefold), so distinct authors are left untouched. Genuine
case-only renames (e.g. "stephen king" -> "Stephen King") still work.

Fixes #3403
Fixes #3170

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 12:33:48 +02:00
..
2024-11-04 21:20:34 +01:00
2025-04-12 03:59:32 +08:00
2026-04-15 23:03:30 +02:00
2026-04-25 13:26:40 +02:00
2026-02-14 11:30:50 +01:00
2022-05-22 12:49:00 +01:00
2024-09-07 20:07:45 +02:00
2026-04-15 20:31:40 +02:00
2022-05-21 21:52:59 +01:00
2025-03-23 09:18:48 +01:00
2026-05-17 10:21:19 +02:00
2026-04-14 22:12:57 +02:00
2026-04-14 22:12:57 +02:00
2024-07-02 20:53:08 +02:00
2026-04-14 22:10:30 +02:00
2024-12-13 18:03:14 +01:00
2025-03-23 15:12:06 +01:00
2024-07-29 20:08:17 +02:00
2026-04-14 22:28:06 +02:00
2025-03-30 12:03:12 +02:00
2025-12-20 13:22:20 +01:00
2025-11-22 15:06:40 +01:00
2026-03-01 15:44:29 +01:00
2024-11-11 18:46:07 +01:00
2026-02-18 18:59:29 +01:00
2026-05-17 10:21:19 +02:00