master
Aevann1 2022-04-25 21:52:30 +02:00
parent 4bf5a2a3c4
commit ad47e9524a
3 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,8 @@ class Submission(Base):
__tablename__ = "submissions"
id = Column(Integer, primary_key=True)
if SITE in ('cringetopia.org','watchpeopledie.co'):
site = Column(Integer)
author_id = Column(Integer, ForeignKey("users.id"))
edited_utc = Column(Integer, default=0)
created_utc = Column(Integer)

View File

@ -318,6 +318,8 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
elif v.subs == 3:
posts = posts.filter(Submission.sub != None, Submission.sub.notin_(v.all_blocks))
if site == 'cringetopia.org': posts = posts.filter_by(site=1)
elif site == 'watchpeopledie.co': posts = posts.filter_by(site=2)
if gt: posts = posts.filter(Submission.created_utc > gt)
if lt: posts = posts.filter(Submission.created_utc < lt)
@ -398,6 +400,9 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
if v and v.admin_level < 2:
pins = pins.filter(Submission.author_id.notin_(v.userblocks))
if site == 'cringetopia.org': pins = pins.filter_by(site=1)
elif site == 'watchpeopledie.co': pins = pins.filter_by(site=2)
pins = pins.all()
for pin in pins:

View File

@ -1128,6 +1128,9 @@ def submit_post(v, sub=None):
ghost=ghost
)
if SITE == 'cringetopia.org': post.site = 1
elif SITE == 'watchpeopledie.co': post.site = 2
g.db.add(post)
g.db.flush()