Catch errors on db.set_cover().

This commit is contained in:
Jim Miller 2013-04-25 22:00:58 -05:00
parent 1ba1da4d65
commit f20a02a2bc
3 changed files with 7 additions and 3 deletions

View file

@ -1281,7 +1281,10 @@ class FanFictionDownLoaderPlugin(InterfaceAction):
existingepub = db.format(book_id,'EPUB',index_is_id=True, as_file=True)
epubmi = get_metadata(existingepub,'EPUB')
if epubmi.cover_data[1] is not None:
db.set_cover(book_id, epubmi.cover_data[1])
try:
db.set_cover(book_id, epubmi.cover_data[1])
except:
print("Failed to set_cover, skipping")
# set author link if found. All current adapters have authorUrl, except anonymous on AO3.
if 'authorUrl' in book['all_metadata']:

View file

@ -139,6 +139,7 @@ Some more longer description. "I suck at summaries!" "Better than it sounds!"
self.story.addToList('characters','J. Rizzoli')
self.story.addToList('category',u'Pitch Perfect')
self.story.addToList('characters','Chloe B.')
self.story.addToList('ships','Chloe B. & J. Rizzoli')
elif self.story.getMetadata('storyId') == '82':
self.story.addToList('characters','Henry (Once Upon a Time)')
self.story.addToList('category',u'Once Upon a Time (TV)')

View file

@ -599,12 +599,12 @@
Use the URL of the story's chapter list, such as
<br /><a href="http://www.henneth-annun.net/stories/chapter.cfm?stid=1234">http://www.henneth-annun.net/stories/chapter.cfm?stid=1234</a>
</dd>
<dt>http://www.psychfic.com</dt>
<dt>www.psychfic.com</dt>
<dd>
Use the URL of the story's chapter list, such as
<br /><a href="http://www.psychfic.com/viewstory.php?sid=1234">http://www.psychfic.com/viewstory.php?sid=1234</a>
</dd>
<dt>http://tokra.fandomnet.com</dt>
<dt>tokra.fandomnet.com</dt>
<dd>
Use the URL of the story's chapter list, such as
<br /><a href="http://tokra.fandomnet.com/viewstory.php?sid=1234">http://tokra.fandomnet.com/viewstory.php?sid=1234</a>