forked from MarseyWorld/MarseyWorld
remove Media query i dont remember the purpose of
parent
32910c5cf5
commit
023b398759
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue