fix last commit

master
Aevann1 2022-10-11 19:28:08 +02:00
parent a9dd6bf1e7
commit 0cb2a56f5c
1 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ def webm_to_mp4(old, new, vid):
db = db_session() db = db_session()
media = db.query(Media).filter_by(filename=name, kind='video').one_or_none() media = db.query(Media).filter_by(filename=new, kind='video').one_or_none()
if media: db.delete(media) if media: db.delete(media)
media = Media( media = Media(
@ -107,7 +107,7 @@ def process_video(file):
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True) subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True)
os.remove(old) os.remove(old)
media = g.db.query(Media).filter_by(filename=name, kind='video').one_or_none() media = g.db.query(Media).filter_by(filename=new, kind='video').one_or_none()
if media: g.db.delete(media) if media: g.db.delete(media)
media = Media( media = Media(
@ -186,7 +186,7 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal
db = db or g.db db = db or g.db
media = db.query(Media).filter_by(filename=name, kind='image').one_or_none() media = db.query(Media).filter_by(filename=filename, kind='image').one_or_none()
if media: db.delete(media) if media: db.delete(media)
media = Media( media = Media(