From 6ef47009b88cec15485b3e41562361d4e2795c37 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Mon, 8 Nov 2021 01:05:24 -0800 Subject: [PATCH] mp4 and svg support --- suchwow/config.py | 5 +++-- suchwow/templates/index.html | 13 ++++++++++--- suchwow/templates/post/read.html | 10 +++++++++- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/suchwow/config.py b/suchwow/config.py index 2c318a1..1d84a0f 100644 --- a/suchwow/config.py +++ b/suchwow/config.py @@ -42,5 +42,6 @@ MM_ENDPOINT = getenv('MM_ENDPOINT', 'ppppppppppppppppppppppppp') # defaults SESSION_TYPE = 'filesystem' -ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'} -MAX_CONTENT_LENGTH = 16 * 1024 * 1024 +ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif', 'svg', 'mp4'} +MAX_CONTENT_LENGTH = 32 * 1024 * 1024 +TEMPLATES_AUTO_RELOAD = getenv('TEMPLATES_AUTO_RELOAD', True) diff --git a/suchwow/templates/index.html b/suchwow/templates/index.html index addaa58..656557d 100644 --- a/suchwow/templates/index.html +++ b/suchwow/templates/index.html @@ -16,13 +16,20 @@ {% if posts %} {% for row in posts | batch(4) %}
- {% for post in row %} - {% set post = post.show() %} + {% for p in row %} + {% set post = p.show() %}
diff --git a/suchwow/templates/post/read.html b/suchwow/templates/post/read.html index c05e3c3..4f56a62 100644 --- a/suchwow/templates/post/read.html +++ b/suchwow/templates/post/read.html @@ -25,7 +25,15 @@ {% endif %}

Submitted by {{ post.submitter }} at {{ post.timestamp }}

- + + {% if post.get_image_path().endswith('mp4') %} + + {% else %} + SuchWow #{{ post.id }} - {{ post.title }} by {{ post.submitter }} + {% endif %}