From 023b398759b4abb2763696ebfa9cc7cd59163b34 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 17 Mar 2023 12:50:49 +0200 Subject: [PATCH] remove Media query i dont remember the purpose of --- files/helpers/media.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index 848c8ab2d..570f12129 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -94,8 +94,6 @@ def process_audio(file, v): abort(400) os.remove(old) - media = g.db.query(Media).filter_by(filename=new, kind='audio').one_or_none() - if media: g.db.delete(media) media = Media( kind='audio', @@ -121,9 +119,6 @@ def convert_to_mp4(old, new, vid, db): os.replace(tmp, new) os.remove(old) - media = db.query(Media).filter_by(filename=new, kind='video').one_or_none() - if media: db.delete(media) - media = Media( kind='video', filename=new, @@ -169,9 +164,6 @@ def process_video(file, v): os.remove(old) - media = g.db.query(Media).filter_by(filename=new, kind='video').one_or_none() - if media: g.db.delete(media) - media = Media( kind='video', filename=new, @@ -269,9 +261,6 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in db = db or g.db - media = db.query(Media).filter_by(filename=filename, kind='image').one_or_none() - if media: db.delete(media) - media = Media( kind='image', filename=filename,