Ticket #4731 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

"Reset cover to default" does not work properly

Reported by: Grins Owned by: Starson17
Priority: minor Milestone:
Component: Default Version: trunk
Keywords: Cc:

Description

Within "Edit Meta Information" one can either load a new cover for an ebook or delete the existing cover and a default one.

The removal of the existing cover by "reset cover to default" does not delete the cover and does not set the default cover. Although the cover first vanishes within "Edit Meta Information" it is still there after pressing "OK" and leaving. Again entering the Edit Meta Information" the old cover is still seen.

Win XP SP 3, calibre 0.6.36

Cheers

Chris

Attachments

my-changes Download (2.4 KB) - added by Starson17 7 months ago.
Possible fix for reset cover problem on individual book metadata screen.

Change History

comment:1 Changed 7 months ago by Starson17

I checked this, and you're right, it's a bug. If you want the cover removed, you can select the book in the main window (not the individual popup metadata window), right click, choose "Remove books" then "Remove covers from selected books." That works. Alternatively, you can delete the cover.jpg file in the database manually (but this is not recommended).

Kovid, this is probably in my skill level. If you haven't fixed it, I'm willing to look for the bug.

comment:2 follow-up: ↓ 3 Changed 7 months ago by kovidgoyal

  • Owner changed from kovidgoyal to Starson17
  • Status changed from new to assigned

Sure, go ahead.

Changed 7 months ago by Starson17

Possible fix for reset cover problem on individual book metadata screen.

comment:3 in reply to: ↑ 2 Changed 7 months ago by Starson17

Replying to kovidgoyal:

Sure, go ahead.

OK, the attached changes will fix it, but I suspect it's not the best way. The main library loops through selected ids with: self.library_view.model().db.remove_cover(id) to remove covers. remove_cover is in the Library Database?2 class from: src\calibre\library\database2.py/868

so in metadata_single.py I just imported: from calibre.library.database2 import Library Database?2 and added: self.db.remove_cover(self.id) to the do_reset_cover in metadata_single.py.

do_reset_cover is executed when the reset cover button is clicked.

I would need to look more carefully at how the

self.cover_changed = True self.cover_data = None

flag, data are supposed to work and need more testing to be sure I didn't step on anything, but you can probably see the answer at a glance.

comment:4 Changed 7 months ago by Starson17

Testing seems to be OK. I was thinking that I could revert to the default image within metadata_single.py using the self.cover_changed flag, but I've realized that the default book image is not stored as cover.jpg in the database, so you would need to delete that file no matter what. That delete functionality is in the database2 module.

comment:5 Changed 7 months ago by kovidgoyal

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in branch trunk. The fix will be in the next release.

Note: See TracTickets for help on using tickets.