From b76e50719bac8e9b4082b65a0c66b74114e02539 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Fri, 1 Mar 2013 10:57:42 -0600 Subject: [PATCH] Use existing anthology title on update, even when a series. --- calibre-plugin/ffdl_plugin.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 88ccb13c..c0640389 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -1117,22 +1117,19 @@ class FanFictionDownLoaderPlugin(InterfaceAction): existingbook = None if 'mergebook' in options: existingbook = options['mergebook'] + #print("existingbook:\n%s"%existingbook) mergebook = self.merge_meta_books(existingbook,good_list) if 'mergebook' in options: mergebook['calibre_id'] = options['mergebook']['calibre_id'] - #mergeid = options['mergebook']['calibre_id'] if 'anthology_url' in options: mergebook['url'] = options['anthology_url'] - - print("mergebook:\n%s"%mergebook) + + #print("mergebook:\n%s"%mergebook) if mergebook['good']: # there shouldn't be any !'good' books at this point. # if still 'good', make a temp file to write the output to. - # For HTML format users, make the filename inside the zip something reasonable. - # For crazy long titles/authors, limit it to 200chars. - # For weird/OS-unsafe characters, use file safe only. tmp = PersistentTemporaryFile(suffix='.'+options['fileform'], dir=options['tdir']) print("title:"+mergebook['title']) @@ -1690,14 +1687,14 @@ class FanFictionDownLoaderPlugin(InterfaceAction): "\n".join([ "%s by %s"%(b['title'],', '.join(b['author'])) for b in book_list ]) # book['all_metadata']['description'] - # if all same series, use series for name. But only if all and not previous named - if len(serieslist) == len(book_list): - series = serieslist[0] - book['title'] = series+" Anthology" - for sr in serieslist: - if series != sr: - book['title'] = deftitle; - break + # if all same series, use series for name. But only if all and not previous named + if len(serieslist) == len(book_list): + series = serieslist[0] + book['title'] = series+" Anthology" + for sr in serieslist: + if series != sr: + book['title'] = deftitle; + break book['all_metadata']['title'] = book['title'] # because custom columns are set from all_metadata book['all_metadata']['author'] = ", ".join(book['author'])