mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #7934 (Database corruption error)
This commit is contained in:
parent
b2ace1e470
commit
3cc953d621
@ -1967,7 +1967,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def cleanup_tags(cls, tags):
|
def cleanup_tags(cls, tags):
|
||||||
tags = [x.strip() for x in tags if x.strip()]
|
tags = [x.strip().replace(',', ';') for x in tags if x.strip()]
|
||||||
tags = [x.decode(preferred_encoding, 'replace') \
|
tags = [x.decode(preferred_encoding, 'replace') \
|
||||||
if isbytestring(x) else x for x in tags]
|
if isbytestring(x) else x for x in tags]
|
||||||
tags = [u' '.join(x.split()) for x in tags]
|
tags = [u' '.join(x.split()) for x in tags]
|
||||||
|
@ -427,7 +427,9 @@ class SchemaUpgrade(object):
|
|||||||
|
|
||||||
def upgrade_version_15(self):
|
def upgrade_version_15(self):
|
||||||
'Remove commas from tags'
|
'Remove commas from tags'
|
||||||
self.conn.execute("UPDATE tags SET name=REPLACE(name, ',', ';')")
|
self.conn.execute("UPDATE OR IGNORE tags SET name=REPLACE(name, ',', ';')")
|
||||||
|
self.conn.execute("UPDATE OR IGNORE tags SET name=REPLACE(name, ',', ';;')")
|
||||||
|
self.conn.execute("UPDATE OR IGNORE tags SET name=REPLACE(name, ',', '')")
|
||||||
|
|
||||||
def upgrade_version_16(self):
|
def upgrade_version_16(self):
|
||||||
self.conn.executescript('''
|
self.conn.executescript('''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user