From 51eff7f9b54412df500b01874286777ea1ca7b97 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 1 Feb 2025 12:40:30 +0530 Subject: [PATCH] self --- content/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/models.py b/content/models.py index dc5f2c2..50f3dc0 100644 --- a/content/models.py +++ b/content/models.py @@ -170,20 +170,20 @@ class Content(models.Model): ('og:title', self.title), ] if self.photo and self.photo.image.url.endswith('.gif'): - video_path = c.photo.image.path.replace('.gif', '.mp4') - image_path = c.photo.image.path.replace('.gif', '.jpg') + video_path = self.photo.image.path.replace('.gif', '.mp4') + image_path = self.photo.image.path.replace('.gif', '.jpg') if not os.path.exists(video_path): cmd = [ 'ffmpeg', '-hide_banner', '-nostats', '-loglevel', 'error', - '-i', c.photo.image.path, video_path + '-i', self.photo.image.path, video_path ] subprocess.call(cmd) if not os.path.exists(image_path): cmd = [ 'ffmpeg', '-hide_banner', '-nostats', '-loglevel', 'error', - '-i', c.photo.image.path, '-frames:v', '1', image_path + '-i', self.photo.image.path, '-frames:v', '1', image_path ] subprocess.call(cmd) if os.path.exists(video_path):