This commit is contained in:
parent
0101a82ddf
commit
1917ff908b
1 changed files with 7 additions and 20 deletions
|
|
@ -162,12 +162,11 @@ def _build_channels_html(
|
||||||
if channels_all:
|
if channels_all:
|
||||||
items: list[SafeString] = [
|
items: list[SafeString] = [
|
||||||
format_html(
|
format_html(
|
||||||
'<li><a href="https://twitch.tv/{}" title="Watch {} on Twitch">{}</a></li>',
|
'<li><a href="https://twitch.tv/{}">{}</a></li>',
|
||||||
ch.name,
|
channel.name,
|
||||||
ch.display_name,
|
channel.display_name,
|
||||||
ch.display_name,
|
|
||||||
)
|
)
|
||||||
for ch in channels_all[:max_links]
|
for channel in channels_all[:max_links]
|
||||||
]
|
]
|
||||||
if total > max_links:
|
if total > max_links:
|
||||||
items.append(format_html("<li>... and {} more</li>", total - max_links))
|
items.append(format_html("<li>... and {} more</li>", total - max_links))
|
||||||
|
|
@ -191,10 +190,8 @@ def _build_channels_html(
|
||||||
"Game %s has no Twitch directory URL for channel fallback link",
|
"Game %s has no Twitch directory URL for channel fallback link",
|
||||||
game,
|
game,
|
||||||
)
|
)
|
||||||
if (
|
|
||||||
getattr(game, "details_url", "")
|
if "twitch-chat-badges-guide" in getattr(game, "details_url", ""):
|
||||||
== "https://help.twitch.tv/s/article/twitch-chat-badges-guide "
|
|
||||||
):
|
|
||||||
# TODO(TheLovinator): Improve detection of global emotes # noqa: TD003
|
# TODO(TheLovinator): Improve detection of global emotes # noqa: TD003
|
||||||
return format_html("{}", "<ul><li>Global Twitch Emote?</li></ul>")
|
return format_html("{}", "<ul><li>Global Twitch Emote?</li></ul>")
|
||||||
|
|
||||||
|
|
@ -273,7 +270,7 @@ def _construct_drops_summary(
|
||||||
linked_name: SafeString = format_html(
|
linked_name: SafeString = format_html(
|
||||||
'<a href="https://twitch.tv/{}" >{}</a>',
|
'<a href="https://twitch.tv/{}" >{}</a>',
|
||||||
channel_name,
|
channel_name,
|
||||||
benefit_name,
|
channel_name,
|
||||||
)
|
)
|
||||||
if badge_desc:
|
if badge_desc:
|
||||||
benefit_names.append((
|
benefit_names.append((
|
||||||
|
|
@ -759,10 +756,6 @@ class GameCampaignFeed(Feed):
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
desc_text: str | None = getattr(item, "description", None)
|
|
||||||
if desc_text:
|
|
||||||
parts.append(format_html("<p>{}</p>", desc_text))
|
|
||||||
|
|
||||||
# Insert start and end date info
|
# Insert start and end date info
|
||||||
insert_date_info(item, parts)
|
insert_date_info(item, parts)
|
||||||
|
|
||||||
|
|
@ -783,12 +776,6 @@ class GameCampaignFeed(Feed):
|
||||||
if details_url:
|
if details_url:
|
||||||
parts.append(format_html('<a href="{}">About</a>', details_url))
|
parts.append(format_html('<a href="{}">About</a>', details_url))
|
||||||
|
|
||||||
account_link_url: str | None = getattr(item, "account_link_url", None)
|
|
||||||
if account_link_url:
|
|
||||||
parts.append(
|
|
||||||
format_html(' | <a href="{}">Link Account</a>', account_link_url),
|
|
||||||
)
|
|
||||||
|
|
||||||
return SafeText("".join(str(p) for p in parts))
|
return SafeText("".join(str(p) for p in parts))
|
||||||
|
|
||||||
def item_pubdate(self, item: DropCampaign) -> datetime.datetime:
|
def item_pubdate(self, item: DropCampaign) -> datetime.datetime:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue