From e453ade9cb0e9c9da96f2013ae456dcfc46f579b Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sun, 18 Jun 2017 10:08:27 -0500 Subject: [PATCH] Allow multiple range URLs (url[1-5]) for same story in one download. --- calibre-plugin/fff_plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/calibre-plugin/fff_plugin.py b/calibre-plugin/fff_plugin.py index 86a05492..b71502a6 100644 --- a/calibre-plugin/fff_plugin.py +++ b/calibre-plugin/fff_plugin.py @@ -2365,10 +2365,10 @@ class FanFicFarePlugin(InterfaceAction): uniqueurls = set() for i, url in enumerate(urls): book = self.convert_url_to_book(url) - if book['url'] in uniqueurls: + if book['uniqueurl'] in uniqueurls: book['good'] = False book['comment'] = _("Same story already included.") - uniqueurls.add(book['url']) + uniqueurls.add(book['uniqueurl']) book['listorder']=i # BG d/l jobs don't come back in order. # Didn't matter until anthologies & 'marked' successes books.append(book) @@ -2385,7 +2385,9 @@ class FanFicFarePlugin(InterfaceAction): if book['begin'] and not mc.group('comma'): book['end'] = book['begin'] - self.set_book_url_and_comment(book,url) + self.set_book_url_and_comment(book,url) # normalizes book[url] + # for case of trying to download book by sections. url[1-5], url[6-10], etc. + book['uniqueurl']="%s[%s-%s]"%(book['url'],book['begin'],book['end']) return book # basic book, plus calibre_id. Assumed bad until proven