diff --git a/files/helpers/const.py b/files/helpers/const.py index b51a548d0a..88693f2cef 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -292,7 +292,7 @@ elif SITE == 'pcmemes.net': LOTTERY_TICKET_COST = 12 LOTTERY_SINK_RATE = -8 elif SITE == 'watchpeopledie.co': - WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.co, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.co/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nThough, while I have your attention (realistically I probably don't; this is quite a lot of text) - if you'd like to fund WPD's continued existence in the face of commercial and governmental censors, it would be really cool if you'd stop by our [Gumroad page](https://wpd.gumroad.com/l/WPD) and consider contributing some paltry sum each month to help us pay for hosting. *But only if you want*. **We do not serve ads. We will never serve ads. We do not sell data. We will never sell data. We do not paywall ANY usage of the site. We will never paywall ANY usage of the site.** Any and all contributions are strictly voluntary and should only be because you'd like to help the site continue to grow and thrive.\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! We are on [GitHub](https://github.com/Aevann1/rDrama).\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!""" + WELCOME_MSG = """Hi, you! Welcome to WatchPeopleDie.co, this really cool site where you can go to watch people die. I'm @CLiTPEELER! If you have any questions about how things work here, or suggestions on how to make them work better than they already do, definitely slide on into my DMs (no fat chicks).\nThere's an enormously robust suite of fun features we have here and we're always looking for more to add. Way, way too many to go over in an automated welcome message. And you're probably here for the videos of people dying more than any sort of weird, paradoxical digital community aspect anyway, so I won't bore you with a tedious overview of them. Just head on over to [your settings page](https://watchpeopledie.co/settings/profile) and have a look at some of the basic profile stuff, at least. You can change your profile picture, username, flair, colors, banners, bio, profile anthem (autoplaying song on your page, like it's MySpace or some shit, hell yeah), CSS, all sorts of things.\nOr you can just go back to the main feed and carry on with watching people die. That's what the site is for, after all. Have fun!\nThough, while I have your attention (realistically I probably don't; this is quite a lot of text) - if you'd like to fund WPD's continued existence in the face of commercial and governmental censors, it would be really cool if you'd stop by our [Kofi page](https://ko-fi.com/wpdco/tiers) and consider contributing some paltry sum each month to help us pay for hosting. *But only if you want*. **We do not serve ads. We will never serve ads. We do not sell data. We will never sell data. We do not paywall ANY usage of the site. We will never paywall ANY usage of the site.** Any and all contributions are strictly voluntary and should only be because you'd like to help the site continue to grow and thrive.\nAnyway, in closing, WPD is entirely open source. We don't really need new full-time coders or anything, but if you'd like to take a look at our repo - or even submit a PR to change, fix, or add some things - go right ahead! We are on [GitHub](https://github.com/Aevann1/rDrama).\nWell, that's all. Thanks again for signing up. It's an automated message and all, but I really do mean that. Thank you, specifically. I love you. Romantically. Deeply. Passionately.\nHave fun!""" FEATURES['PATRON_ICONS'] = True @@ -1026,7 +1026,6 @@ def is_safe_url(url): hosts = "|".join(approved_embed_hosts).replace('.','\.') SITE_NAME = environ.get("SITE_NAME").strip() -GUMROAD_LINK = environ.get("GUMROAD_LINK", "https://marsey1.gumroad.com/l/rdrama").strip() HCAPTCHA_SITEKEY = environ.get("HCAPTCHA_SITEKEY","").strip() HCAPTCHA_SECRET = environ.get("HCAPTCHA_SECRET","").strip() SPAM_SIMILARITY_THRESHOLD = float(environ.get("SPAM_SIMILARITY_THRESHOLD", 0.5)) @@ -1035,6 +1034,7 @@ SPAM_SIMILAR_COUNT_THRESHOLD = int(environ.get("SPAM_SIMILAR_COUNT_THRESHOLD", 1 COMMENT_SPAM_SIMILAR_THRESHOLD = float(environ.get("COMMENT_SPAM_SIMILAR_THRESHOLD", 0.5)) COMMENT_SPAM_COUNT_THRESHOLD = int(environ.get("COMMENT_SPAM_COUNT_THRESHOLD", 10)) DESCRIPTION = environ.get("DESCRIPTION", "rdrama.net caters to drama in all forms such as: Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all!").strip() +GUMROAD_LINK = environ.get("GUMROAD_LINK", "https://marsey1.gumroad.com/l/rdrama").strip() GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip() GUMROAD_ID = environ.get("GUMROAD_ID", "rdrama").strip() DEFAULT_THEME = environ.get("DEFAULT_THEME", "midnight").strip() diff --git a/files/routes/comments.py b/files/routes/comments.py index f154d3a161..c9ae52659c 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -261,7 +261,7 @@ def comment(v): Comment.parent_comment_id == parent_comment_id, Comment.parent_submission == parent_submission, Comment.body_html == body_html - ).one_or_none() + ).first() if existing: return {"error": f"You already made that comment: /comment/{existing.id}"}, 409 if parent.author.any_block_exists(v) and v.admin_level < 2: diff --git a/files/routes/users.py b/files/routes/users.py index 265aa0e07e..071db4ce80 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -703,7 +703,7 @@ def message2(v, username): body_html = sanitize(message) - if not (SITE == 'rdrama.net' and message == '!withdrawall' and user.id == 12732): + if not (SITE == 'rdrama.net' and user.id == 12732): existing = g.db.query(Comment.id).filter(Comment.author_id == v.id, Comment.sentto == user.id, Comment.body_html == body_html, @@ -1390,7 +1390,7 @@ def kofi(): if verification_token != KOFI_TOKEN: abort(400) id = data['kofi_transaction_id'] - created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%S"))) + created_utc = int(time.mktime(time.strptime(data['timestamp'].split('.')[0], "%Y-%m-%dT%H:%M:%SZ"))) type = data['type'] amount = int(float(data['amount'])) email = data['email'] diff --git a/files/routes/votes.py b/files/routes/votes.py index bb17cadf9a..513f3572f2 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -34,20 +34,6 @@ def vote_info_get(v, link): downs = g.db.query(CommentVote).filter_by(comment_id=thing_id, vote_type=-1 ).order_by(CommentVote.created_utc).all() - if v.admin_level: - up_ids = [x[0] for x in g.db.query(CommentVote.user_id).filter_by(comment_id=thing_id, vote_type=1).order_by(CommentVote.created_utc).all()] - total_ups = g.db.query(func.sum(User.truecoins)).filter(User.id.in_(up_ids)).scalar() - total_ups = format(total_ups, ",") if total_ups else '0' - patrons_ups = g.db.query(User).filter(User.id.in_(up_ids), User.patron > 0).count() - - return render_template("votes.html", - v=v, - thing=thing, - ups=ups, - downs=downs, - total_ups=total_ups, - patrons_ups=patrons_ups) - else: abort(400) return render_template("votes.html", diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 69efff7db5..e1d726fdb9 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -14,7 +14,11 @@

401 Not Authorized

This page is only available to {% if SITE_NAME == 'rDrama' %}paypigs{% else %}patrons{% endif %}:

{% if FEATURES['PROCOINS'] -%} - {{GUMROAD_LINK}} + {% if KOFI_LINK %} + {{KOFI_LINK}} + {% else %} + {{GUMROAD_LINK}} + {% endif %} {%- endif %} diff --git a/files/templates/expanded_image_modal.html b/files/templates/expanded_image_modal.html index d6c00d25fe..65b6d1d73e 100644 --- a/files/templates/expanded_image_modal.html +++ b/files/templates/expanded_image_modal.html @@ -6,7 +6,7 @@
- expanded image + expanded image
diff --git a/files/templates/header.html b/files/templates/header.html index 8b990369b8..8f90fcb2cc 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -225,7 +225,11 @@ My profile Settings {% if FEATURES['PROCOINS'] %} - Donate + {% if KOFI_LINK %} + Donate + {% else %} + Donate + {% endif %} {% endif %} @@ -292,7 +296,11 @@ {% if FEATURES['PROCOINS'] %} - Donate + {% if KOFI_LINK %} + Donate + {% else %} + Donate + {% endif %} {% endif %} {% if not g.webview %} diff --git a/files/templates/votes.html b/files/templates/votes.html index 37b337b079..da986cb7fa 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -20,11 +20,6 @@

Upvotes: {{ups | length}}

Downvotes: {{downs | length}}

-{% if v.admin_level and (total_ups and patrons_ups) %} -

Total Truescore: {{total_ups}}

-

Total Paypigs: {{patrons_ups}}

-{% endif %} -

Upvotes

diff --git a/seed-db.sql b/seed-db.sql index a6bfc22b12..71698c129e 100644 --- a/seed-db.sql +++ b/seed-db.sql @@ -1668,4 +1668,4 @@ insert into hat_defs (name, description, author_id, price) values ('Family Man Free Hat', 'It''s a good show!', 2, 500), ('Engineer', 'Choo choo!', 2, 500), ('Vexillaurius Helmet', 'Degenerates like you belong on rDrama', 2, 500), -('Astronaut Helmet', 'See you, space marsey', 2, 500); \ No newline at end of file +('Astronaut Helmet', 'See you, space marsey', 2, 500); diff --git a/sql/20220702-poll-rework.sql b/sql/20220702-poll-rework.sql index 789638dc7b..fb7524cd07 100644 --- a/sql/20220702-poll-rework.sql +++ b/sql/20220702-poll-rework.sql @@ -106,4 +106,4 @@ ALTER TABLE ONLY public.comment_option_votes ADD CONSTRAINT vote_user_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) MATCH FULL; ALTER TABLE ONLY public.comment_option_votes - ADD CONSTRAINT vote_comment_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id) MATCH FULL; \ No newline at end of file + ADD CONSTRAINT vote_comment_fkey FOREIGN KEY (comment_id) REFERENCES public.comments(id) MATCH FULL; diff --git a/sql/20220831-casino-feature.sql b/sql/20220831-casino-feature.sql index 4b2882661c..f3dfd87cd6 100644 --- a/sql/20220831-casino-feature.sql +++ b/sql/20220831-casino-feature.sql @@ -12,4 +12,4 @@ CREATE TABLE casino_games ( winnings integer NOT NULL, kind casino_game_kind NOT NULL, game_state jsonb NOT NULL -); \ No newline at end of file +); diff --git a/sql/20220903-hats.sql b/sql/20220903-hats.sql index 84cea7a167..895305f6f1 100644 --- a/sql/20220903-hats.sql +++ b/sql/20220903-hats.sql @@ -246,4 +246,4 @@ insert into hat_defs (name, description, author_id, price) values ('Family Man Free Hat', 'It''s a good show!', 2, 500), ('Engineer', 'Choo choo!', 2, 500), ('Vexillaurius Helmet', 'Degenerates like you belong on rDrama', 2, 500), -('Astronaut Helmet', 'See you, space marsey', 2, 500); \ No newline at end of file +('Astronaut Helmet', 'See you, space marsey', 2, 500); diff --git a/sql/20220909-marsey-submissin-ui.sql b/sql/20220909-marsey-submissin-ui.sql index 50ea9b7151..7321779aad 100644 --- a/sql/20220909-marsey-submissin-ui.sql +++ b/sql/20220909-marsey-submissin-ui.sql @@ -3,4 +3,4 @@ alter table marseys add column submitter_id int; ALTER TABLE ONLY public.marseys ADD CONSTRAINT marsey_submitter_fkey FOREIGN KEY (submitter_id) REFERENCES public.users(id); -CREATE INDEX marseys_idx4 ON public.marseys USING btree (submitter_id); \ No newline at end of file +CREATE INDEX marseys_idx4 ON public.marseys USING btree (submitter_id); diff --git a/sql/20220910-hat-submissin-ui.sql b/sql/20220910-hat-submissin-ui.sql index d40bfbb187..6d65079240 100644 --- a/sql/20220910-hat-submissin-ui.sql +++ b/sql/20220910-hat-submissin-ui.sql @@ -3,4 +3,4 @@ alter table hat_defs add column submitter_id int; ALTER TABLE ONLY public.hat_defs ADD CONSTRAINT hat_def_submitter_fkey FOREIGN KEY (submitter_id) REFERENCES public.users(id); -CREATE INDEX hat_defs_submitter_id_idx ON public.hat_defs USING btree (submitter_id); \ No newline at end of file +CREATE INDEX hat_defs_submitter_id_idx ON public.hat_defs USING btree (submitter_id); diff --git a/sql/20220910-notify-followers.sql b/sql/20220910-notify-followers.sql index d47c0fe84a..908a72169a 100644 --- a/sql/20220910-notify-followers.sql +++ b/sql/20220910-notify-followers.sql @@ -1,2 +1,2 @@ alter table submissions add column notify bool not null default true; -alter table submissions alter column notify drop default; \ No newline at end of file +alter table submissions alter column notify drop default; diff --git a/sql/20220911-add-roulette.sql b/sql/20220911-add-roulette.sql index 154f614591..a7f49f11c1 100644 --- a/sql/20220911-add-roulette.sql +++ b/sql/20220911-add-roulette.sql @@ -1 +1 @@ -ALTER TYPE casino_game_kind ADD VALUE 'roulette'; \ No newline at end of file +ALTER TYPE casino_game_kind ADD VALUE 'roulette'; diff --git a/sql/20220913-transactions.sql b/sql/20220913-transactions.sql index f887687963..927e99144b 100644 --- a/sql/20220913-transactions.sql +++ b/sql/20220913-transactions.sql @@ -6,4 +6,4 @@ CREATE TABLE public.transactions ( email character varying(255) NOT NULL ); -CREATE INDEX transactions_email_idx ON public.transactions USING btree (email); \ No newline at end of file +CREATE INDEX transactions_email_idx ON public.transactions USING btree (email);