master
Aevann1 2022-05-16 22:57:47 +02:00
parent d560caae8d
commit e0c1e6b4cd
2 changed files with 7 additions and 6 deletions

View File

@ -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"

View File

@ -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('.','\.')