11-26-2012, 07:28 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Nov 2012
Device: Onyx Boox M92
|
New recipe - calibre adds it two times
Hi,
I wrote a recipe to download news from jungewelt.de. junge Welt already provides the current newspaper in epub and pdf. So I decided to use the re-useable code from achims https://www.mobileread.com/forums/sho...1&postcount=16 This is what I have: Spoiler:
As achims suggested, I am adding the two files to the database myself so that the two books appear as one book in calibre with different formats. (calibredb add -1 does it.) Additionionally calibre assembles the unzipped epub again. But when I already added the epub I don't need that calibre adds it again.. So again in short: At the moment when I use the plugin, I get two books in calibre, one with the assembled epub and another book with the original epub and the pdf in it. Can I change that somehow? Except for that it is ready to be used. Thanks |
11-26-2012, 09:41 PM | #2 |
creator of calibre
Posts: 43,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The only way to prevent that is to abort the recipe. Raise a exception at the end of the build_index() method.
|
Advert | |
|
11-27-2012, 03:53 AM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Nov 2012
Device: Onyx Boox M92
|
Ok,
then it looks like that: Spoiler:
But that is really ugly. Now it exits with a big FAILED popup. No user will understand that. And to read my exception message you have to scroll down to the end... Is there no better solution? |
11-28-2012, 05:59 PM | #4 |
Junior Member
Posts: 3
Karma: 10
Join Date: Nov 2012
Device: Onyx Boox M92
|
Instead of throwing an error, I decided to use sys.exit(). Then the plugin did not fail but exits normally.
Spoiler:
Unfortunately something or someone adds another news ebook with the name "XXXXXX recipe out". The x are always different letters. The epub in it is invalid as it is empty (0byte). Maybe it is easier to change that? |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Times UK Recipe working for you ? | RichardN | Recipes | 3 | 08-20-2012 07:47 PM |
Request: small recipe that adds borders to a borderless table inside an RSS feed | mopol | Recipes | 0 | 03-01-2012 03:26 PM |
Patch: Calibre adds tags to identify ebook formats created by calibre. | siebert | Calibre | 1 | 07-18-2011 02:07 PM |
NY Times Recipe Changes | bcollier | Recipes | 1 | 03-04-2011 11:52 AM |
NY Times Recipe in Calibre 6.36 Fails | keyrunner | Calibre | 1 | 01-28-2010 11:56 AM |