mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 01:33:30 +02: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
1 changed files with 2 additions and 1 deletions
|
|
@ -1403,7 +1403,7 @@ def remove_format(self, index, format, index_is_id=False, notify=True,
|
|||
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 @@ def remove_format(self, index, format, index_is_id=False, notify=True,
|
|||
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…
Reference in a new issue