mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression in 0.8.36 that caused the remove format from book function to only delete the entry from the database and not delete the actual file from the disk
This commit is contained in:
parent
b9b2e386c8
commit
c96112fada
@ -1403,7 +1403,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
id = index if index_is_id else self.id(index)
|
||||
if not format: format = ''
|
||||
self.format_metadata_cache[id].pop(format.upper(), None)
|
||||
name = self.format_filename_cache[id].pop(format.upper(), None)
|
||||
name = self.format_filename_cache[id].get(format.upper(), None)
|
||||
if name:
|
||||
if not db_only:
|
||||
try:
|
||||
@ -1412,6 +1412,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
delete_file(path)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
self.format_filename_cache[id].pop(format.upper(), None)
|
||||
self.conn.execute('DELETE FROM data WHERE book=? AND format=?', (id, format.upper()))
|
||||
if commit:
|
||||
self.conn.commit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user