mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Automatically dirty existing books if FTS db is empty
Allows simply deleting the fts db file to force a rescan
This commit is contained in:
parent
72f137c650
commit
e40731ab34
@ -40,6 +40,11 @@ class FTS:
|
||||
SchemaUpgrade(conn)
|
||||
conn.fts_dbpath = dbpath
|
||||
conn.execute('UPDATE fts_db.dirtied_formats SET in_progress=FALSE WHERE in_progress=TRUE')
|
||||
num_dirty = conn.get('''SELECT COUNT(*) from fts_db.dirtied_formats''')[0][0]
|
||||
if not num_dirty:
|
||||
num_indexed = conn.get('''SELECT COUNT(*) from fts_db.books_text''')[0][0]
|
||||
if not num_indexed:
|
||||
self.dirty_existing()
|
||||
|
||||
def get_connection(self):
|
||||
db = self.dbref()
|
||||
|
Loading…
x
Reference in New Issue
Block a user