Fix #4731 ("Reset cover to default" does not work properly)

This commit is contained in:
Kovid Goyal 2010-01-31 14:59:23 -07:00
parent 6af7b6a43e
commit 2c6c222adf
2 changed files with 8 additions and 2 deletions

View File

@ -51,6 +51,9 @@
- title: "Fix error while sending book with non-ascii character in title/author to device on linux"
tickets: [4690]
- title: "Fix reset cover in edit meta information dialog does not actually remove cover"
tickets: [4731]
new recipes:
- title: Kamera Bild
author: Darko Miletic

View File

@ -653,8 +653,11 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
d = d + self.local_timezone_offset
self.db.set_timestamp(self.id, d)
if self.cover_changed and self.cover_data is not None:
self.db.set_cover(self.id, self.cover_data)
if self.cover_changed:
if self.cover_data is not None:
self.db.set_cover(self.id, self.cover_data)
else:
self.db.remove_cover(self.id)
except IOError, err:
if err.errno == 13: # Permission denied
fname = err.filename if err.filename else 'file'