JimmXinu / FanFicFare

FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites.
Other
746 stars 158 forks source link

Cover metada not writtent correctly when updating existing ePub story #899

Closed albyofdoom closed 1 year ago

albyofdoom commented 1 year ago

When updating an existing ePub, even with Overwrite Always selected, the following metadata is not being added. These are correctly written when downloading a new book, but not on updates. Doesn't seem to be localized to any specific site.

In content.opf:

  <guide>
    <reference type="cover" title="Cover" href="OEBPS/titlepage.xhtml"/>
  </guide>

In OEBPS/titlepage.xhtml, in the <head> tag:

<meta name="calibre:cover" content="true" />
JimmXinu commented 1 year ago

FFF doesn't use titlepage.xhtml as the cover--that's a Calibre thing. FFF uses cover.xhtml for cover (and title_page.xhtml for it's metadata containing title page).

I suspect you used Calibre's Edit book or Polish features at some point.

albyofdoom commented 1 year ago

I tested with a new story, picked at random https://archiveofourown.org/works/18880045, downloaded it with FFF, opened the ePub manually as a zip, checked the files with notepad, and the metadata existed. I then closed without making any changes, then triggered "Updated Existing Fanfiction Books" with "Overwrite Always" selected, and the resulting ePub was missing that metadata.

Could it maybe be tied to the integration of the Generate Cover plugin? These are the settings I use for covers.

image

JimmXinu commented 1 year ago

'Inject/update cover inside EPUB' works by calling Calibre's Polish book feature, so that will follow Calibre's conventions instead of FFF's.

If I now understand correctly, I think you reported the issue with too much specificity--your problem isn't with the metadata details, it's with the absence of any cover in the EPUB.

When you do 'Overwrite Always' on an existing book while also having 'Only for New Books' checked for both updating and generating a cover, the cover already in the epub is discarded, but because it is not a new book, a new cover is generated and injected.

If you do 'Update EPUB' or 'Update EPUB Always' instead of 'Overwrite Always', the cover will be retained.

So everything appears to be functioning as designed.

albyofdoom commented 1 year ago

Perfect, thank you for the clarification!