forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-18 15:25:04 +02:00
parent 5e7478d7f8
commit 1f6a4b0130
2 changed files with 5 additions and 5 deletions

View File

@ -225,7 +225,7 @@ class User(Base, Stndrd, Age_times):
def strid(self):
return str(self.id)
@cache.memoize(timeout=86400)
@cache.memoize(timeout=3600)
def userpagelisting(self, v=None, page=1, sort="new", t="all"):
if self.shadowbanned and not (v and (v.admin_level >= 3 or v.id == self.id)):
@ -443,7 +443,7 @@ class User(Base, Stndrd, Age_times):
if self.bannerurl: return self.bannerurl
else: return f"https://{site}/assets/images/{site_name}/preview.webp"
@cache.memoize(timeout=86400)
@cache.memoize(timeout=3600)
def defaultpicture(self):
pic = random.randint(1, 150)
return f"https://{site}/assets/images/defaultpictures/{pic}.webp"

View File

@ -108,7 +108,7 @@ def notifications(v):
is_notification_page=True)
@cache.memoize(timeout=86400)
@cache.memoize(timeout=3600)
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs):
posts = g.db.query(Submission).options(lazyload('*'))
@ -262,7 +262,7 @@ def front_all(v):
else: return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page)
@cache.memoize(timeout=86400)
@cache.memoize(timeout=3600)
def changeloglist(v=None, sort="new", page=1 ,t="all", **kwargs):
posts = g.db.query(Submission).options(lazyload('*')).options(lazyload('*')).filter_by(is_banned=False, private=False,).filter(Submission.deleted_utc == 0)
@ -374,7 +374,7 @@ def random_post(v):
post = x.offset(n).limit(1).first()
return redirect(f"/post/{post.id}")
@cache.memoize(timeout=86400)
@cache.memoize(timeout=3600)
def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all", **kwargs):
posts = g.db.query(Submission).options(lazyload('*'))