This commit is contained in:
Markos Gogoulos
2025-05-16 12:10:27 +03:00
parent adc424dd01
commit e22fee0e0c
3 changed files with 18 additions and 7 deletions
+4
View File
@@ -410,10 +410,14 @@ def produce_sprite_from_video(friendly_token):
if os.path.exists(output_name) and get_file_type(output_name) == "image":
with open(output_name, "rb") as f:
myfile = File(f)
# SOS: avoid race condition, since this runs for a long time and will replace any other media changes on the meanwhile!!!
media.sprites.save(
content=myfile,
name=get_file_name(media.media_file.path) + "sprites.jpg",
save=False
)
media.save(update_fields=["sprites"])
except Exception as e:
print(e)
return True