exercise video hls
This commit is contained in:
@@ -33,6 +33,11 @@ class ExerciseVideo(models.Model):
|
|||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
video_file = models.FileField(upload_to='exercise_videos/', null=True, verbose_name="")
|
video_file = models.FileField(upload_to='exercise_videos/', null=True, verbose_name="")
|
||||||
|
|
||||||
|
def save(self, **kwargs):
|
||||||
|
super(ExerciseVideo, self).save(**kwargs)
|
||||||
|
filename = self.video_file.name
|
||||||
|
create_hls_tasks.delay(filename)
|
||||||
|
|
||||||
@receiver(pre_delete, sender=ExerciseVideo)
|
@receiver(pre_delete, sender=ExerciseVideo)
|
||||||
def delete_exercise_video(sender, instance, using, **kwargs):
|
def delete_exercise_video(sender, instance, using, **kwargs):
|
||||||
video_file = instance.video_file
|
video_file = instance.video_file
|
||||||
|
|||||||
Reference in New Issue
Block a user