Fix thumbnail_thread passing uploader to media.

remotes/1693176582716663532/tmp_refs/heads/watchparty
Snakes 2022-10-06 05:15:21 -04:00
parent 7eefcf5308
commit 24167b1d09
Signed by: Snakes
GPG Key ID: E745A82778055C7E
2 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ def process_video(file):
def process_image(filename=None, resize=0, trim=False, patron=False):
def process_image(filename=None, resize=0, trim=False, uploader=None, patron=False):
size = os.stat(filename).st_size
if size > 16 * 1024 * 1024 or not patron and size > 8 * 1024 * 1024:
@ -177,7 +177,7 @@ def process_image(filename=None, resize=0, trim=False, patron=False):
media = Media(
kind='image',
filename=filename.split('/')[-1],
user_id=g.v.id,
user_id=uploader or g.v.id,
size=os.stat(filename).st_size
)
g.db.add(media)

View File

@ -598,7 +598,7 @@ def thumbnail_thread(pid):
for chunk in image_req.iter_content(1024):
file.write(chunk)
post.thumburl = process_image(name, resize=100)
post.thumburl = process_image(name, resize=100, uploader=post.author_id)
db.add(post)
db.commit()
db.close()