Close the file before trying to read file size

This commit is contained in:
Erik Johnston 2024-05-30 10:56:14 +01:00
parent 5d71a6c9b9
commit 5e15d598ce

View file

@ -1049,6 +1049,11 @@ class MediaRepository:
finally:
t_byte_source.close()
# We flush and close the file to ensure that the bytes have
# been written before getting the size.
f.flush()
f.close()
t_len = os.path.getsize(fname)
# Write to database