mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-07 20:11:14 +02:00
Workaround for fimf's API issue with non-viewable chapters given.
This commit is contained in:
parent
0e8a552e8d
commit
8419ef4ad0
1 changed files with 6 additions and 0 deletions
|
|
@ -120,6 +120,12 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
|
|||
self.story.setMetadata("authorUrl", "http://%s/user/%s" % (self.getSiteDomain(), storyMetadata["author"]["name"]))
|
||||
|
||||
chapters = [{"chapterTitle": chapter["title"], "chapterURL": chapter["link"]} for chapter in storyMetadata["chapters"]]
|
||||
|
||||
## this is bit of a kludge based on the assumption all the
|
||||
## 'bad' chapters will be at the end.
|
||||
## limit down to the number of chapters reported by chapter_count.
|
||||
chapters = chapters[:storyMetadata["chapter_count"]]
|
||||
|
||||
for chapter in chapters:
|
||||
self.chapterUrls.append((chapter["chapterTitle"], chapter["chapterURL"]))
|
||||
self.story.setMetadata("numChapters", len(self.chapterUrls))
|
||||
|
|
|
|||
Loading…
Reference in a new issue