Fix xenforo2 prefixtags, some still using tags in title

This commit is contained in:
Jim Miller 2025-06-08 09:41:35 -05:00
parent 3246036f88
commit 006b8873a5

View file

@ -318,14 +318,13 @@ class BaseXenForo2ForumAdapter(BaseSiteAdapter):
def parse_title(self,souptag):
h1 = souptag.find('h1',{'class':'p-title-value'})
# logger.debug(h1)
## April24 Prefix tags moved back out of title at some
## point. This should probably be somewhere else
for tag in souptag.select("div.p-body-header a[href*='prefix_id']"):
## prefixtags included in genre in defaults.ini
## Jun25
## the-sietch still has 'Crossover', 'Sci-Fi' etc spans in the title h1.
## Also populated down near other tags for SV/SB/etc
for tag in h1.find_all('span',{'class':'label'}):
self.story.addToList('prefixtags',stripHTML(tag))
logger.debug("Prefix tag(%s)"%stripHTML(tag))
# tag.extract()
# logger.debug(stripHTML(tag))
tag.extract()
self.story.setMetadata('title',stripHTML(h1))
# logger.debug(stripHTML(h1))
@ -827,6 +826,11 @@ class BaseXenForo2ForumAdapter(BaseSiteAdapter):
if use_threadmark_chaps:
self.set_threadmarks_metadata(useurl,topsoup)
for tag in souptag.select("div.p-body-header span.label"): # a[href*='prefix_id']"):
## prefixtags included in genre in defaults.ini
self.story.addToList('prefixtags',stripHTML(tag))
# logger.debug("Prefix tag(%s)"%stripHTML(tag))
if use_threadmark_chaps or self.getConfig('always_use_forumtags'):
## only use tags if threadmarks for chapters or always_use_forumtags is on.
tagmap = {