From 3aa8be64496c37386adf9e7a350edcba4be76316 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 8 Mar 2025 12:25:58 +0000 Subject: [PATCH] When renaming items, serialize item names before writing to the db. This ensures author "B, A" is written as "B| A", --- src/calibre/db/tables.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/tables.py b/src/calibre/db/tables.py index 51d5b8e802..ff3a2ae1db 100644 --- a/src/calibre/db/tables.py +++ b/src/calibre/db/tables.py @@ -515,7 +515,8 @@ class ManyToManyTable(ManyToOneTable): if existing_item is None or existing_item == item_id: # A simple rename will do the trick self.id_map[item_id] = new_name - db.execute(f'UPDATE {table} SET {col}=? WHERE id=?', (new_name, item_id)) + nn = self.serialize(new_name) if self.serialize else new_name + db.execute(f'UPDATE {table} SET {col}=? WHERE id=?', (nn, item_id)) else: # We have to replace new_id = existing_item