From 0cb2a56f5c276e27d6e8400a774b60e6d5eb408d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 11 Oct 2022 19:28:08 +0200 Subject: [PATCH] fix last commit --- files/helpers/media.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index d078489e9..8be8d47e0 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -71,7 +71,7 @@ def webm_to_mp4(old, new, vid): 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) 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) 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) media = Media( @@ -186,7 +186,7 @@ def process_image(filename=None, resize=0, trim=False, uploader=None, patron=Fal 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) media = Media(