Fix DB session for webm_to_mp4.

remotes/1693176582716663532/tmp_refs/heads/watchparty
Snakes 2022-11-15 06:24:17 -05:00
parent 781daeed2f
commit b50a815eb0
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ from werkzeug.utils import secure_filename
from PIL import Image
from PIL import UnidentifiedImageError
from PIL.ImageSequence import Iterator
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm.session import Session
from files.classes.media import *
from files.helpers.cloudflare import purge_files_in_cache
@ -103,7 +103,7 @@ def process_video(file, v):
if extension == 'webm':
new = new.replace('.webm', '.mp4')
copyfile(old, new)
db = scoped_session()
db = Session(bind=g.db.get_bind(), autoflush=False)
gevent.spawn(webm_to_mp4, old, new, v.id, db)
else:
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True)