1
0
Fork 0

Bold Denuvo cracks.

This commit is contained in:
Casper V. Kristensen 2019-05-16 20:40:44 +02:00
parent 54bf9902b9
commit 6cd8e69f3f
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -23,13 +23,17 @@ def popularity(release: Release):
def row(release: Release):
# Bold row if Denuvo crack. We're checking this first so as to not actually insert 'DENUVO' as a highlight
highlights = [h for h in release.highlights if h not in ("DENUVO",)] # avoids modifying original release object
bold = highlights != release.highlights
# The rows in the table containing updates will use the full rls_name as the name, while tables
# containing game and DLC releases will show tags and highlights, as well as the stylized game_name.
if release.type == ReleaseType.UPDATE:
name = f"[{release.rls_name}]({release.nfo_link})"
else:
tags = " ({})".format(" ".join(release.tags)) if release.tags else ""
highlights = " **- {}**".format(", ".join(release.highlights)) if release.highlights else ""
highlights = " **- {}**".format(", ".join(highlights)) if highlights else ""
name = "[{}{}]({}){}".format(util.markdown_escape(release.game_name),
tags,
release.nfo_link,
@ -43,7 +47,11 @@ def row(release: Release):
num_reviews_humanized = util.humanize(release.num_reviews, precision=1, prefix="dec", suffix="")
reviews = f"{release.score:.0%} ({num_reviews_humanized})"
return name, release.group, stores, reviews
r = (name, release.group, stores, reviews)
if bold:
r = tuple(f"**{c.replace('**', '')}**" for c in r) # .replace ensures no nested bold, which is unsupported
return r
def generate_post(releases: Releases) -> str: