mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Oops. Restore removed call to commit in set_path and have set_path call dirtied. Also limit the rate of metadata backups
This commit is contained in:
parent
0acfe17e53
commit
993983a707
@ -48,6 +48,7 @@ class MetadataBackup(Thread): # {{{
|
||||
time.sleep(2)
|
||||
if not self.dump_func([id_]):
|
||||
prints('Failed to backup metadata for id:', id_, 'again, giving up')
|
||||
time.sleep(0.2) # Limit to five per second
|
||||
|
||||
# }}}
|
||||
|
||||
|
@ -455,6 +455,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
self.add_format(id, format, stream, index_is_id=True,
|
||||
path=tpath, notify=False)
|
||||
self.conn.execute('UPDATE books SET path=? WHERE id=?', (path, id))
|
||||
self.dirtied([id], commit=False)
|
||||
self.commit()
|
||||
self.data.set(id, self.FIELD_MAP['path'], path, row_is_id=True)
|
||||
# Delete not needed directories
|
||||
if current_path and os.path.exists(spath):
|
||||
|
Loading…
x
Reference in New Issue
Block a user