basexf: Fix for prefix tags, put in prefixtags included in genre

This commit is contained in:
Jim Miller 2024-04-09 10:57:34 -05:00
parent 36d56b867c
commit c915aceb85
3 changed files with 13 additions and 10 deletions

View file

@ -749,7 +749,7 @@ author_avatar_cover:false
strip_chapter_numbers:false
## Copy title to tagsfromtitle for parsing tags.
add_to_extra_valid_entries:,tagsfromtitledetect,tagsfromtitle,forumtags,contenttags,formattags,parentforums
add_to_extra_valid_entries:,tagsfromtitledetect,tagsfromtitle,forumtags,prefixtags,contenttags,formattags,parentforums
## '.NOREPL' tells the system to *not* apply title's
## in/exclude/replace_metadata -- Only works on include_in_ lines.
@ -760,6 +760,7 @@ tagsfromtitle_label:Tags from Title
forumtags_label:Tags from Forum
## Note that forumtags also contains tags populated into category,
## genre, characters, contenttags and formattags
prefixtags_label:Prefix Tags from Forum
contenttags_label:Content Tags from Forum
formattags_label:Format Tags from Forum
@ -827,7 +828,7 @@ capitalize_forumtags:true
## Add forumtags to standard entry genre and tagsfromtitle to
## category. Can be changed in personal.ini if desired.
include_in_genre:genre,forumtags
include_in_genre:genre,forumtags,prefixtags
include_in_category:category,tagsfromtitle,parentforums
## base_xenforoforum reads Published and Updated datetimes from

View file

@ -89,12 +89,13 @@ class BaseXenForo2ForumAdapter(BaseXenForoForumAdapter):
def parse_title(self,souptag):
h1 = souptag.find('h1',{'class':'p-title-value'})
# logger.debug(h1)
## SV has started putting 'Crossover', 'Sci-Fi' etc spans in the title h1.
for tag in h1.find_all('span',{'class':'label'}):
## stick them into genre.
self.story.addToList('genre',stripHTML(tag))
# logger.debug(stripHTML(tag))
tag.extract()
## April24 Prefix tags moved back out of title at some
## point. This should probably be somewhere else
for tag in souptag.select("a[href*='prefix_id']"):
## prefixtags included in genre in defaults.ini
self.story.addToList('prefixtags',stripHTML(tag))
logger.debug("Prefix tag(%s)"%stripHTML(tag))
# tag.extract()
self.story.setMetadata('title',stripHTML(h1))
# logger.debug(stripHTML(h1))

View file

@ -741,7 +741,7 @@ author_avatar_cover:false
strip_chapter_numbers:false
## Copy title to tagsfromtitle for parsing tags.
add_to_extra_valid_entries:,tagsfromtitledetect,tagsfromtitle,forumtags,contenttags,formattags,parentforums
add_to_extra_valid_entries:,tagsfromtitledetect,tagsfromtitle,forumtags,prefixtags,contenttags,formattags,parentforums
## '.NOREPL' tells the system to *not* apply title's
## in/exclude/replace_metadata -- Only works on include_in_ lines.
@ -752,6 +752,7 @@ tagsfromtitle_label:Tags from Title
forumtags_label:Tags from Forum
## Note that forumtags also contains tags populated into category,
## genre, characters, contenttags and formattags
prefixtags_label:Prefix Tags from Forum
contenttags_label:Content Tags from Forum
formattags_label:Format Tags from Forum
@ -819,7 +820,7 @@ capitalize_forumtags:true
## Add forumtags to standard entry genre and tagsfromtitle to
## category. Can be changed in personal.ini if desired.
include_in_genre:genre,forumtags
include_in_genre:genre,forumtags,prefixtags
include_in_category:category,tagsfromtitle,parentforums
## base_xenforoforum reads Published and Updated datetimes from