diff --git a/calibre-plugin/plugin-defaults.ini b/calibre-plugin/plugin-defaults.ini index 966108a5..a8c4def5 100644 --- a/calibre-plugin/plugin-defaults.ini +++ b/calibre-plugin/plugin-defaults.ini @@ -2331,6 +2331,8 @@ description_in_chapter: false ## This option will attemph to fetch the stories. fetch_stories_from_api: true +include_chapter_descriptions_in_summary: false + ## Clear FanFiction from defaults, site is original fiction. extratags:Erotica diff --git a/fanficfare/adapters/adapter_literotica.py b/fanficfare/adapters/adapter_literotica.py index 36b0bc09..f1e231f8 100644 --- a/fanficfare/adapters/adapter_literotica.py +++ b/fanficfare/adapters/adapter_literotica.py @@ -235,19 +235,19 @@ class LiteroticaSiteAdapter(BaseSiteAdapter): ## look first for 'Series Introduction', then Info panel short desc ## series can have either, so put in common code. + desc = [] introtag = soup.select_one('div.bp_rh') - descdiv = soup.select_one('div#tabpanel-info div.bn_B') - if not descdiv: - descdiv = soup.select_one('div[class^="_tab__pane_"] div[class^="_widget__info_"]') + descdiv = soup.select_one('div#tabpanel-info div.bn_B') or \ + soup.select_one('div[class^="_tab__pane_"] div[class^="_widget__info_"]') if introtag and stripHTML(introtag): # make sure there's something in the tag. # logger.debug("intro %s"%introtag) - self.setDescription(self.url,introtag) + desc.append(unicode(introtag)) elif descdiv and stripHTML(descdiv): # make sure there's something in the tag. # logger.debug("desc %s"%descdiv) - self.setDescription(self.url,descdiv) - else: + desc.append(unicode(descdiv)) + if not desc or self.getConfig("include_chapter_descriptions_in_summary"): ## Only for backward compatibility with 'stories' that ## don't have an intro or short desc. descriptions = [] @@ -257,7 +257,9 @@ class LiteroticaSiteAdapter(BaseSiteAdapter): descriptions.append("%d. %s" % (i + 1, stripHTML(chapterdesctag))) # now put it back--it's used below chapterdesctag.append(a) - self.setDescription(authorurl,"

"+"

\n

".join(descriptions)+"

") + desc.append(unicode("

"+"

\n

".join(descriptions)+"

")) + + self.setDescription(self.url,u''.join(desc)) if isSingleStory: ## one-shots don't *display* date info, but they have it diff --git a/fanficfare/configurable.py b/fanficfare/configurable.py index e81a4585..9da9ba70 100644 --- a/fanficfare/configurable.py +++ b/fanficfare/configurable.py @@ -271,6 +271,7 @@ def get_valid_set_options(): 'order_chapters_by_date':(['literotica.com'],None,boollist), 'tags_from_chapters':(['literotica.com'],None,boollist), 'dates_from_chapters':(['literotica.com'],None,boollist), + 'include_chapter_descriptions_in_summary':(['literotica.com'],None,boollist), 'inject_chapter_title':(['asianfanfics.com']+wpc_list,None,boollist), 'inject_chapter_image':(['asianfanfics.com'],None,boollist), @@ -528,6 +529,7 @@ def get_valid_keywords(): 'fetch_stories_from_api', 'tags_from_chapters', 'dates_from_chapters', + 'include_chapter_descriptions_in_summary', 'inject_chapter_title', 'inject_chapter_image', 'append_datepublished_to_storyurl', diff --git a/fanficfare/defaults.ini b/fanficfare/defaults.ini index 6ea633c6..6d547a61 100644 --- a/fanficfare/defaults.ini +++ b/fanficfare/defaults.ini @@ -2324,6 +2324,8 @@ description_in_chapter: false ## This option will attemph to fetch the stories. fetch_stories_from_api: true +include_chapter_descriptions_in_summary: false + ## Clear FanFiction from defaults, site is original fiction. extratags:Erotica