diff --git a/fanficfare/adapters/adapter_bloodshedversecom.py b/fanficfare/adapters/adapter_bloodshedversecom.py index 21b6e349..eb113797 100644 --- a/fanficfare/adapters/adapter_bloodshedversecom.py +++ b/fanficfare/adapters/adapter_bloodshedversecom.py @@ -157,9 +157,6 @@ class BloodshedverseComAdapter(BaseSiteAdapter): self.story.addToList('warnings', warning) - elif key == 'Chapters': - self.story.setMetadata('numChapters', int(value)) - elif key == 'Words': # Apparently only numChapters need to be an integer for # some strange reason. Remove possible ',' characters as to diff --git a/fanficfare/adapters/adapter_ficbooknet.py b/fanficfare/adapters/adapter_ficbooknet.py index e2240317..580409e1 100644 --- a/fanficfare/adapters/adapter_ficbooknet.py +++ b/fanficfare/adapters/adapter_ficbooknet.py @@ -157,7 +157,6 @@ class FicBookNetAdapter(BaseSiteAdapter): update = chapterdate else: self.add_chapter(self.story.getMetadata('title'),url) - self.story.setMetadata('numChapters',1) date_str = soup.find('div', {'class' : 'part-date'}).find('span', {'title': True})['title'].replace(u"\u202fг. в", "") for month_name, month_num in fullmon.items(): date_str = date_str.replace(month_name, month_num) diff --git a/fanficfare/adapters/adapter_fictionmaniatv.py b/fanficfare/adapters/adapter_fictionmaniatv.py index 2aa3e145..52493e81 100644 --- a/fanficfare/adapters/adapter_fictionmaniatv.py +++ b/fanficfare/adapters/adapter_fictionmaniatv.py @@ -40,10 +40,6 @@ class FictionManiaTVAdapter(BaseSiteAdapter): self._setURL(self.READ_TEXT_STORY_URL_TEMPLATE % story_id) self.story.setMetadata('siteabbrev', self.SITE_ABBREVIATION) - # Always single chapters, probably should use the Anthology feature to - # merge chapters of a story - self.story.setMetadata('numChapters', 1) - @staticmethod def getSiteDomain(): return FictionManiaTVAdapter.SITE_DOMAIN diff --git a/fanficfare/adapters/adapter_fireflyfansnet.py b/fanficfare/adapters/adapter_fireflyfansnet.py index 237c4f16..28967918 100644 --- a/fanficfare/adapters/adapter_fireflyfansnet.py +++ b/fanficfare/adapters/adapter_fireflyfansnet.py @@ -105,7 +105,6 @@ class FireFlyFansNetSiteAdapter(BaseSiteAdapter): # to download them one at a time yourself. I'm also setting the status to # complete self.add_chapter(self.story.getMetadata('title'), self.url) - self.story.setMetadata('numChapters', 1) self.story.setMetadata('status', 'Completed') ## some stories do not have a summary listed, so I'm setting it here. diff --git a/fanficfare/adapters/adapter_kakuyomujp.py b/fanficfare/adapters/adapter_kakuyomujp.py index c01eeed9..e709f878 100644 --- a/fanficfare/adapters/adapter_kakuyomujp.py +++ b/fanficfare/adapters/adapter_kakuyomujp.py @@ -197,8 +197,6 @@ class KakuyomuJpAdapter(BaseSiteAdapter): self.add_chapter(epTitle, epUrl) newSection = False - self.story.setMetadata('numChapters', numEpisodes) - logger.debug("Story: <%s>", self.story) return diff --git a/fanficfare/adapters/adapter_masseffect2in.py b/fanficfare/adapters/adapter_masseffect2in.py index f2a3abab..3d3945c0 100644 --- a/fanficfare/adapters/adapter_masseffect2in.py +++ b/fanficfare/adapters/adapter_masseffect2in.py @@ -204,7 +204,6 @@ class MassEffect2InAdapter(BaseSiteAdapter): self.story.setMetadata('datePublished', datePublished) self.story.setMetadata('dateUpdated', dateUpdated) self.story.setMetadata('numWords', unicode(wordCount)) - self.story.setMetadata('numChapters', len(chapters)) # Site-specific metadata. self.story.setMetadata('language', self.SITE_LANGUAGE) diff --git a/fanficfare/adapters/adapter_swiorgru.py b/fanficfare/adapters/adapter_swiorgru.py index 4f6b2298..82481cb5 100644 --- a/fanficfare/adapters/adapter_swiorgru.py +++ b/fanficfare/adapters/adapter_swiorgru.py @@ -120,13 +120,9 @@ class SwiOrgRuAdapter(BaseSiteAdapter): self.story.setMetadata('language','Russian') chapters=chapters_table.find_all('a', href=re.compile(r'/mlp-fim/story/'+self.story.getMetadata('storyId')+r"/chapter\d+")) - self.story.setMetadata('numChapters', len(chapters)) - logger.debug("numChapters: (%s)"%str(self.story.getMetadata('numChapters'))) - - for x in range(0,len(chapters)): - chapter=chapters[x] - churl='http://'+self.host+chapter['href'] - self.add_chapter(chapter,churl) + for chapter in chapters: + churl='http://'+self.host+chapter['href'] + self.add_chapter(chapter,churl) # grab the text for an individual chapter. def getChapterText(self, url): diff --git a/fanficfare/adapters/adapter_syosetucom.py b/fanficfare/adapters/adapter_syosetucom.py index ce439e99..a858d6e9 100644 --- a/fanficfare/adapters/adapter_syosetucom.py +++ b/fanficfare/adapters/adapter_syosetucom.py @@ -255,7 +255,6 @@ class SyosetuComAdapter(BaseSiteAdapter): numChapters = int(re.sub(r'[^\d]', '', infoSoup.find('span', {'class':'p-infotop-type__allep'}).text.strip())) oneshot = False completed = True if noveltype == '完結済' else False - self.story.setMetadata('numChapters', numChapters) self.story.setMetadata('status', 'Completed' if completed else 'In-Progress') # Keywords diff --git a/fanficfare/adapters/adapter_touchfluffytail.py b/fanficfare/adapters/adapter_touchfluffytail.py index c634e482..84e408db 100644 --- a/fanficfare/adapters/adapter_touchfluffytail.py +++ b/fanficfare/adapters/adapter_touchfluffytail.py @@ -101,7 +101,6 @@ class TouchFluffyTailAdapter(BaseSiteAdapter): self.story.setMetadata('status', 'Completed') self.add_chapter(self.story.getMetadata('title'),url) - self.story.setMetadata('numChapters',1) avrrate = body.find_all('footer', class_='entry-meta')[1].find('em').span.find_all('strong') averrating = avrrate[1].text diff --git a/fanficfare/adapters/adapter_trekfanfictionnet.py b/fanficfare/adapters/adapter_trekfanfictionnet.py index 06b9e408..a04d2db9 100644 --- a/fanficfare/adapters/adapter_trekfanfictionnet.py +++ b/fanficfare/adapters/adapter_trekfanfictionnet.py @@ -126,11 +126,6 @@ class TrekFanFictionNetSiteAdapter(BaseSiteAdapter): ## url since we can't get the chapter without this, I'm leaving it in. self.add_chapter(self.story.getMetadata('title'), url) - ## I'm going to comment this out, because thereis always only one chapter for each story, - ## so this is really not needed - ## And I am uncommenting it because the rest of FFF expects - ## there to always be numChapters, even if it's one. --Jimm - # getting the rest of the metadata... there isn't much here, and the summary can only be # gotten on the author's page... so we'll get it to get the information from adata = self.get_request(self.story.getMetadata('authorUrl')) diff --git a/fanficfare/adapters/adapter_voracity2eficcom.py b/fanficfare/adapters/adapter_voracity2eficcom.py index e90017a3..c73f3a58 100644 --- a/fanficfare/adapters/adapter_voracity2eficcom.py +++ b/fanficfare/adapters/adapter_voracity2eficcom.py @@ -199,9 +199,6 @@ class Voracity2EficComAdapter(BaseSiteAdapter): self.story.setMetadata('series', a.string) self.story.setMetadata('seriesUrl', urlparse.urljoin(self.BASE_URL, a['href'])) - elif key == 'Chapter': - self.story.setMetadata('numChapters', int(value)) - elif key == 'Completed': self.story.setMetadata('status', 'Completed' if value == 'Yes' else 'In-Progress') diff --git a/fanficfare/adapters/base_efiction_adapter.py b/fanficfare/adapters/base_efiction_adapter.py index 62ab7f74..2c3cae7f 100644 --- a/fanficfare/adapters/base_efiction_adapter.py +++ b/fanficfare/adapters/base_efiction_adapter.py @@ -317,8 +317,6 @@ class BaseEfictionAdapter(BaseSiteAdapter): for val in re.split(r"\s*,\s*", value): # TODO this should be an official field I guess self.story.addToList('challenge', val) - elif key == 'Chapters': - self.story.setMetadata('numChapters', int(value)) elif key == 'Rating' or key == 'Rated': self.story.setMetadata('rating', value) elif key == 'Word count': diff --git a/fanficfare/adapters/base_otw_adapter.py b/fanficfare/adapters/base_otw_adapter.py index 068f0d01..e9458354 100644 --- a/fanficfare/adapters/base_otw_adapter.py +++ b/fanficfare/adapters/base_otw_adapter.py @@ -320,7 +320,6 @@ class BaseOTWAdapter(BaseSiteAdapter): # break epub update. # Find the chapters: chapters=soup.find_all('a', href=re.compile(r'/works/'+self.story.getMetadata('storyId')+r"/chapters/\d+$")) - self.story.setMetadata('numChapters',len(chapters)) logger.debug("numChapters: (%s)"%self.story.getMetadata('numChapters')) if len(chapters)==1: self.add_chapter(self.story.getMetadata('title'),'https://'+self.host+chapters[0]['href'])