Merge branch 'frost' into feature-award-feature-flag

This commit is contained in:
Snakes 2023-02-11 23:41:41 -05:00 committed by GitHub
commit 84e5c7c651
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 248 additions and 526 deletions

View file

@ -346,8 +346,8 @@ class Submission(Base):
url = self.url.replace("old.reddit.com", v.reddit)
if '/comments/' in url and "sort=" not in url:
if "?" in url: url += "&context=9"
else: url += "?context=8"
if "?" in url: url += f"&context={RENDER_DEPTH_LIMIT}"
else: url += f"?context={RENDER_DEPTH_LIMIT - 1}"
if v.controversial: url += "&sort=controversial"
return url
elif self.url:
@ -382,22 +382,13 @@ class Submission(Base):
def plainbody(self, v):
if self.club and not (v and (v.paid_dues or v.id == self.author_id)): return f"<p>{CC} ONLY</p>"
body = self.body
if not body: return ""
if v:
body = body.replace("old.reddit.com", v.reddit)
if v.nitter and '/i/' not in body and '/retweets' not in body: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
return body
def print(self):
print(f'post: {self.id}, author: {self.author_id}', flush=True)
return ''
@lazy
def realtitle(self, v):
if self.title_html: