forked from MarseyWorld/MarseyWorld
make a piece of code a little prettier
parent
4918e284d5
commit
a0d40c94b5
|
@ -133,12 +133,11 @@ def process_video(file, v):
|
|||
old = f'/videos/{time.time()}'.replace('.','')
|
||||
file.save(old)
|
||||
|
||||
size = os.stat(old).st_size
|
||||
if (SITE_NAME != 'WPD' and
|
||||
(size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024
|
||||
or not v.patron and size > MAX_VIDEO_SIZE_MB * 1024 * 1024)):
|
||||
os.remove(old)
|
||||
abort(413, f"Max video size is {MAX_VIDEO_SIZE_MB} MB ({MAX_VIDEO_SIZE_MB_PATRON} MB for {patron}s)")
|
||||
if SITE_NAME != 'WPD':
|
||||
size = os.stat(old).st_size
|
||||
if size > MAX_VIDEO_SIZE_MB_PATRON * 1024 * 1024 or (not v.patron and size > MAX_VIDEO_SIZE_MB * 1024 * 1024):
|
||||
os.remove(old)
|
||||
abort(413, f"Max video size is {MAX_VIDEO_SIZE_MB} MB ({MAX_VIDEO_SIZE_MB_PATRON} MB for {patron}s)")
|
||||
|
||||
name_original = secure_filename(file.filename)
|
||||
extension = name_original.split('.')[-1].lower()
|
||||
|
|
Loading…
Reference in New Issue