diff --git a/files/classes/submission.py b/files/classes/submission.py index b30cf1e191..d4ec956fc6 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -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) diff --git a/files/routes/front.py b/files/routes/front.py index e0ba3ac24a..59b773ec23 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -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: diff --git a/files/routes/posts.py b/files/routes/posts.py index 7605688763..d3754c93c9 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -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()