From f452ed748e1dab1834163c874b208fa3e0bb162c Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Thu, 30 Nov 2023 23:56:08 +0100 Subject: [PATCH] Fix video cover image dealy --- vrobbler/apps/videos/models.py | 4 ++-- vrobbler/templates/scrobbles/scrobble_list.html | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/vrobbler/apps/videos/models.py b/vrobbler/apps/videos/models.py index f8b054d..53ff5e8 100644 --- a/vrobbler/apps/videos/models.py +++ b/vrobbler/apps/videos/models.py @@ -140,13 +140,13 @@ class Video(ScrobblableMixin): imdb_id = models.CharField(max_length=20, **BNULL) imdb_rating = models.FloatField(**BNULL) cover_image = models.ImageField(upload_to="videos/video/", **BNULL) - cover_small = ImageSpecField( + cover_image_small = ImageSpecField( source="cover_image", processors=[ResizeToFit(100, 100)], format="JPEG", options={"quality": 60}, ) - cover_medium = ImageSpecField( + cover_image_medium = ImageSpecField( source="cover_image", processors=[ResizeToFit(300, 300)], format="JPEG", diff --git a/vrobbler/templates/scrobbles/scrobble_list.html b/vrobbler/templates/scrobbles/scrobble_list.html index bf01980..2a3ef4b 100644 --- a/vrobbler/templates/scrobbles/scrobble_list.html +++ b/vrobbler/templates/scrobbles/scrobble_list.html @@ -171,7 +171,11 @@ {% for scrobble in video_scrobble_list %} {{scrobble.timestamp|naturaltime}} - + {% if scrobble.video.cover_image %} + + {% else %} + + {% endif %} {% if scrobble.video.tv_series%}S{{scrobble.video.season_number}}E{{scrobble.video.episode_number}} -{%endif %} {{scrobble.video.title}} {% if scrobble.video.tv_series %}{{scrobble.video.tv_series}}{% endif %}