forked from rDrama/rDrama
master
parent
a41252d23a
commit
3737b93b0d
|
@ -245,6 +245,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
|
||||||
body = self.comment_aux.body_html
|
body = self.comment_aux.body_html
|
||||||
if not v or v.slurreplacer: body = body.replace(" nigger"," π").replace(" Nigger"," π").replace(" NIGGER"," π").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," π").replace(" Tranny"," π").replace(" TRANNY"," π").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" trump"," DDR").replace(" Trump"," DDR").replace(" TRUMP"," DDR").replace(" biden"," DDD").replace(" Biden"," DDD").replace(" BIDEN"," DDD").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," π").replace(" Trannie"," π").replace(" TRANNIE"," π").replace(" troon"," π").replace(" Troon"," π").replace(" TROON"," π")
|
if not v or v.slurreplacer: body = body.replace(" nigger"," π").replace(" Nigger"," π").replace(" NIGGER"," π").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," π").replace(" Tranny"," π").replace(" TRANNY"," π").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" trump"," DDR").replace(" Trump"," DDR").replace(" TRUMP"," DDR").replace(" biden"," DDD").replace(" Biden"," DDD").replace(" BIDEN"," DDD").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," π").replace(" Trannie"," π").replace(" TRANNIE"," π").replace(" troon"," π").replace(" Troon"," π").replace(" TROON"," π")
|
||||||
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com")
|
||||||
|
|
||||||
return body
|
return body
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -310,9 +310,12 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
def realurl(self, v):
|
def realurl(self, v):
|
||||||
if v and v.agendaposter and random.randint(1, 10) < 4:
|
if v and v.agendaposter and random.randint(1, 10) < 4:
|
||||||
return 'https://secure.actblue.com/donate/ms_blm_homepage_2019'
|
return 'https://secure.actblue.com/donate/ms_blm_homepage_2019'
|
||||||
elif self.url:
|
elif self.url.startswith("https://old.reddit.com/"):
|
||||||
if v and not v.oldreddit: return self.url.replace("old.reddit.com", "reddit.com")
|
url = self.url
|
||||||
if self.url: return self.url
|
if v and not v.oldreddit: url = self.url.replace("old.reddit.com", "reddit.com")
|
||||||
|
if v and v.controversial and '/comments/' in url:
|
||||||
|
if "?" in url: url += "&sort=controversial"
|
||||||
|
else: url += "/?sort=controversial"
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -55,6 +55,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
newtabexternal = Column(Boolean, default=True)
|
newtabexternal = Column(Boolean, default=True)
|
||||||
zzz = Column(Boolean, default=False)
|
zzz = Column(Boolean, default=False)
|
||||||
oldreddit = Column(Boolean, default=False)
|
oldreddit = Column(Boolean, default=False)
|
||||||
|
controversial = Column(Boolean, default=False)
|
||||||
submissions = relationship(
|
submissions = relationship(
|
||||||
"Submission",
|
"Submission",
|
||||||
lazy="dynamic",
|
lazy="dynamic",
|
||||||
|
|
|
@ -786,7 +786,6 @@ def submit_post(v):
|
||||||
url = url.replace("https://mobile.twitter.com", "https://twitter.com")
|
url = url.replace("https://mobile.twitter.com", "https://twitter.com")
|
||||||
if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"):
|
if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"):
|
||||||
url = url.replace("https://streamable.com/", "https://streamable.com/e/")
|
url = url.replace("https://streamable.com/", "https://streamable.com/e/")
|
||||||
# if url.startswith("https://old.reddit.com/") and '/comments/' in url and '?' not in url: url += "?sort=controversial"
|
|
||||||
|
|
||||||
title_html = sanitize(title, linkgen=True, flair=True)
|
title_html = sanitize(title, linkgen=True, flair=True)
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,10 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.oldreddit = request.values.get("oldreddit", None) == 'true'
|
v.oldreddit = request.values.get("oldreddit", None) == 'true'
|
||||||
|
|
||||||
|
if request.values.get("controversial", v.controversial) != v.controversial:
|
||||||
|
updated = True
|
||||||
|
v.controversial = request.values.get("controversial", None) == 'true'
|
||||||
|
|
||||||
if request.values.get("over18", v.over_18) != v.over_18:
|
if request.values.get("over18", v.over_18) != v.over_18:
|
||||||
updated = True
|
updated = True
|
||||||
v.over_18 = request.values.get("over18", None) == 'true'
|
v.over_18 = request.values.get("over18", None) == 'true'
|
||||||
|
|
|
@ -144,6 +144,25 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="d-lg-flex border-bottom">
|
||||||
|
|
||||||
|
<div class="title w-lg-25">
|
||||||
|
<label for="controversial">Sort by Controversial</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="body w-lg-100">
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input type="checkbox" class="custom-control-input" id="controversial" name="controversial"{% if v.controversial %} checked{% endif %} onchange="post_toast('/settings/profile?controversial='+document.getElementById('controversial').checked);">
|
||||||
|
<label class="custom-control-label" for="controversial"></label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="text-small-extra text-muted">Enable if you would like to automatically sort reddit.com links by controversial.</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loadingβ¦
Reference in New Issue