Skip to content

Commit

Permalink
adapter_wattpadcom: Config update & category 0 not always present
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhmw committed Dec 31, 2024
1 parent 33e0b22 commit c85e398
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fanficfare/adapters/adapter_wattpadcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ def extractChapterUrlsAndMetadata(self, get_cover=True):
self.story.setMetadata('language', storyInfo['language']['name'])

# CATEGORIES
# the 0 category is always present but does not have an entry in https://www.wattpad.com/api/v3/categories.
storyInfo['categories'].remove(0)
# The category '0' is almost always present but does not have an entry in the Wattpad API (https://www.wattpad.com/api/v3/categories).
logger.debug('Categories: %s'%str(storyInfo['categories']))
0 in storyInfo['categories'] and storyInfo['categories'].remove(0)
storyCategories = []
for category in WattpadComAdapter.CATEGORY_DEFs:
if category['id'] in storyInfo['categories']:
Expand Down
2 changes: 2 additions & 0 deletions fanficfare/configurable.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def get_valid_set_options():
'skip_sticky_first_posts':(base_xenforo2_list,None,boollist),
'include_dice_rolls':(base_xenforo2_list,None,boollist+['svg']),
'include_chapter_banner_images':(['wattpad.com'],None,boollist),
'dateUpdated_method':(['wattpad.com'],None,['modifyDate', 'lastPublishedPart']),
'fix_excess_space': (['novelonlinefull.com', 'novelall.com'], ['epub', 'html'], boollist),
'dedup_order_chapter_list': (['wuxiaworld.xyz', 'novelupdates.cc'], None, boollist),
'show_nsfw_cover_images': (['fiction.live'], None, boollist),
Expand Down Expand Up @@ -574,6 +575,7 @@ def get_valid_keywords():
'skip_sticky_first_posts',
'include_dice_rolls',
'include_chapter_banner_images',
'dateUpdated_method',
'datethreadmark_format',
'fix_pseudo_html',
'fix_excess_space',
Expand Down

0 comments on commit c85e398

Please sign in to comment.