Fix video filesize check for patrons.

master
Snakes 2022-10-18 22:15:57 -04:00
parent 1a033ecc74
commit 94e130febd
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ def process_video(file):
file.save(old) file.save(old)
size = os.stat(old).st_size size = os.stat(old).st_size
if SITE_NAME != 'WPD' and (size > MAX_VIDEO_SIZE_MB * 1024 * 1024 or not g.v.patron and size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024): if (SITE_NAME != 'WPD' and
(size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024
or not g.v.patron and size > MAX_VIDEO_SIZE_MB * 1024 * 1024)):
os.remove(old) os.remove(old)
abort(413, f"Max video size is {MAX_VIDEO_SIZE_MB} MB ({MAX_VIDEO_SIZE_MB_PATRON} MB for paypigs)") abort(413, f"Max video size is {MAX_VIDEO_SIZE_MB} MB ({MAX_VIDEO_SIZE_MB_PATRON} MB for paypigs)")