forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-01-30 15:40:11 +02:00
parent c387102bdf
commit 7d5fc1b090
6 changed files with 11 additions and 11 deletions

View File

@ -228,7 +228,7 @@ class Comment(Base):
@property @property
@lazy @lazy
def shortlink_context(self): def shortlink_context(self):
return f"/comment/{self.id}?context=9#context" return f"/comment/{self.id}?context=8#context"
@property @property
@lazy @lazy
@ -239,10 +239,10 @@ class Comment(Base):
@property @property
@lazy @lazy
def permalink(self): def permalink(self):
if self.post and self.post.club: return f"{SITE_FULL}/comment/{self.id}?context=9#context" if self.post and self.post.club: return f"{SITE_FULL}/comment/{self.id}?context=8#context"
if self.post: return f"{self.post.permalink}/{self.id}?context=9#context" if self.post: return f"{self.post.permalink}/{self.id}?context=8#context"
else: return f"{SITE_FULL}/comment/{self.id}?context=9#context" else: return f"{SITE_FULL}/comment/{self.id}?context=8#context"
@property @property
@lazy @lazy

View File

@ -93,7 +93,7 @@ class ModAction(Base):
elif self.target_post: elif self.target_post:
if self.target_post.club: return f'<a href="{self.target_post.permalink}">{CC} ONLY</a>' if self.target_post.club: return f'<a href="{self.target_post.permalink}">{CC} ONLY</a>'
return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>' return f'<a href="{self.target_post.permalink}">{self.target_post.title.replace("<","").replace(">","")}</a>'
elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=9#context">comment</a>' elif self.target_comment_id: return f'<a href="/comment/{self.target_comment_id}?context=8#context">comment</a>'
@property @property
@lazy @lazy

View File

@ -336,7 +336,7 @@ class Submission(Base):
elif not v.oldreddit: url = self.url.replace("old.reddit.com", "reddit.com") elif not v.oldreddit: url = self.url.replace("old.reddit.com", "reddit.com")
if '/comments/' in url and "sort=" not in url: if '/comments/' in url and "sort=" not in url:
if "?" in url: url += "&context=9" if "?" in url: url += "&context=9"
else: url += "?context=9" else: url += "?context=8"
if v.controversial: url += "&sort=controversial" if v.controversial: url += "&sort=controversial"
return url return url
elif self.url: elif self.url:

View File

@ -208,7 +208,7 @@ class User(Base):
def ban_reason_link(self): def ban_reason_link(self):
if self.ban_reason: if self.ban_reason:
if self.ban_reason.startswith("/post/"): return self.ban_reason.split(None, 1)[0] if self.ban_reason.startswith("/post/"): return self.ban_reason.split(None, 1)[0]
if self.ban_reason.startswith("/comment/"): return self.ban_reason.split(None, 1)[0] + "?context=9#context" if self.ban_reason.startswith("/comment/"): return self.ban_reason.split(None, 1)[0] + "?context=8#context"
@property @property
@lazy @lazy

View File

@ -534,7 +534,7 @@ def api_comment(v):
'notification': { 'notification': {
'title': f'New reply by @{c.author_name}', 'title': f'New reply by @{c.author_name}',
'body': notifbody, 'body': notifbody,
'deep_link': f'{SITE_FULL}/comment/{c.id}?context=9&read=true#context', 'deep_link': f'{SITE_FULL}/comment/{c.id}?context=8&read=true#context',
'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp', 'icon': f'{SITE_FULL}/assets/images/{SITE_NAME}/icon.webp',
} }
}, },
@ -544,7 +544,7 @@ def api_comment(v):
'body': notifbody, 'body': notifbody,
}, },
'data': { 'data': {
'url': f'/comment/{c.id}?context=9&read=true#context', 'url': f'/comment/{c.id}?context=8&read=true#context',
} }
} }
}, },

View File

@ -666,7 +666,7 @@ def thumbnail_thread(pid):
for term in ('rdrama','freeghettohoes.biz'): for term in ('rdrama','freeghettohoes.biz'):
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={term}&size=100').json()["data"]: for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={term}&size=100').json()["data"]:
body_html = sanitize(f'New rdrama mention: https://old.reddit.com{i["permalink"]}?context=99', noimages=True) body_html = sanitize(f'New rdrama mention: https://old.reddit.com{i["permalink"]}?context=89', noimages=True)
existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html, level=1, sentto=0).first() existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html, level=1, sentto=0).first()
@ -689,7 +689,7 @@ def thumbnail_thread(pid):
for k,v in REDDIT_NOTIFS.items(): for k,v in REDDIT_NOTIFS.items():
for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={k}&size=100').json()["data"]: for i in requests.get(f'https://api.pushshift.io/reddit/{t}/search?html_decode=true&q={k}&size=100').json()["data"]:
try: body_html = sanitize(f'New mention of you: https://old.reddit.com{i["permalink"]}?context=99', noimages=True) try: body_html = sanitize(f'New mention of you: https://old.reddit.com{i["permalink"]}?context=89', noimages=True)
except: continue except: continue
existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html).first() existing_comment = db.query(Comment.id).filter_by(author_id=NOTIFICATIONS_ID, parent_submission=None, distinguish_level=6, body_html=body_html).first()
if existing_comment: break if existing_comment: break