diff --git a/calibre-plugin/jobs.py b/calibre-plugin/jobs.py index 8e99ffc6..e516fae2 100644 --- a/calibre-plugin/jobs.py +++ b/calibre-plugin/jobs.py @@ -251,6 +251,17 @@ def do_download_for_worker(book,options,merge,notification=lambda x,y:x): if not story.getMetadata("series") and 'calibre_series' in book: adapter.setSeries(book['calibre_series'][0],book['calibre_series'][1]) + # logger.debug(merge) + # logger.debug(book.get('epub_for_update','(NONE)')) + # logger.debug(options.get('mergebook','(NOMERGEBOOK)')) + + # is a merge, is a pre-existing anthology, and is not a pre-existing book in anthology. + if merge and 'mergebook' in options and 'epub_for_update' not in book: + # internal for plugin anthologies to mark chapters + # (new) in new stories + story.setMetadata("newforanthology","true") + logger.debug("metadata newforanthology:%s"%story.getMetadata("newforanthology")) + # set PI version instead of default. if 'version' in options: story.setMetadata('version',options['version']) diff --git a/calibre-plugin/plugin-defaults.ini b/calibre-plugin/plugin-defaults.ini index e18f44b7..63fc05e6 100644 --- a/calibre-plugin/plugin-defaults.ini +++ b/calibre-plugin/plugin-defaults.ini @@ -471,6 +471,13 @@ chapter_title_strip_pattern:^[0-9]+[\.: -]+(?=[^0-9]|$) ## If set to latestonly, only new chapters downloaded this time will ## be marked (new) and existing chapters will have any (new) marks ## removed. +## +## (Plugin Only) - New stories added to an existing anthology will +## have *all* chapters marked (new). If set to latestonly, existing +## (new) marks will only be removed when that particular story within +## the anthology is updated--either because it has new chapter(s) or +## you are using Update Always. +## ## mark_new_chapters can be true, false or latestonly mark_new_chapters:false diff --git a/fanficfare/configurable.py b/fanficfare/configurable.py index 176a5dec..e915733e 100644 --- a/fanficfare/configurable.py +++ b/fanficfare/configurable.py @@ -342,6 +342,9 @@ def get_valid_scalar_entries(): 'langcode', 'output_css', 'cover_image', + 'newforanthology' # internal for plugin anthologies + # to mark chapters (new) in new + # stories ]) def get_valid_entries(): diff --git a/fanficfare/story.py b/fanficfare/story.py index ef6dacb2..0f145403 100644 --- a/fanficfare/story.py +++ b/fanficfare/story.py @@ -1409,7 +1409,7 @@ class Story(Requestable): toctempl = string.Template(tocpattern) for index, chap in enumerate(self.chapters): - if chap['new']: + if chap['new'] or self.getMetadata('newforanthology'): usetempl = newtempl else: usetempl = templ