From e0c1e6b4cd228badca6887b974776a660faeb2cf Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 16 May 2022 22:57:47 +0200 Subject: [PATCH] sfd --- files/classes/submission.py | 6 +++--- files/helpers/const.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 34484ab15..84daea59d 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -165,8 +165,6 @@ class Submission(Base): @lazy def edited_string(self): - if not self.edited_utc: return "never" - age = int(time.time()) - self.edited_utc if age < 60: @@ -184,11 +182,13 @@ class Submission(Base): now = time.gmtime() ctd = time.gmtime(self.edited_utc) months = now.tm_mon - ctd.tm_mon + 12 * (now.tm_year - ctd.tm_year) + if now.tm_mday < ctd.tm_mday: + months -= 1 if months < 12: return f"{months}mo ago" else: - years = now.tm_year - ctd.tm_year + years = int(months / 12) return f"{years}yr ago" diff --git a/files/helpers/const.py b/files/helpers/const.py index 03e863a17..72a9ae29b 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -95,9 +95,9 @@ else: "pedocord": "discord (actually a pretty cool service)", "i hate carp": "i love Carp", "manlet": "little king", - "gamer": "g*mer", - "journalist": "journ*list", - "journalism": "journ*lism", + "gamer": "g\*mer", + "journalist": "journ\*list", + "journalism": "journ\*lism", "wuhan flu": "SARS-CoV-2 syndemic", "china flu": "SARS-CoV-2 syndemic", "china virus": "SARS-CoV-2 syndemic", @@ -886,6 +886,7 @@ approved_embed_hosts = [ 'googleapis.com', 'bing.com', 'typekit.net', + 'postimg.cc' ] hosts = "|".join(approved_embed_hosts).replace('.','\.')