Skip to content

Commit

Permalink
Correct default thumbnail size to avoid thumbnail quality downgrade (#…
Browse files Browse the repository at this point in the history
…1230)

Correct default thumbnail size to avoid thumbnail quality downgrade
  • Loading branch information
Badatos authored Nov 27, 2024
1 parent 352c999 commit 062b39e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pod/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,12 +1001,12 @@ def get_player_height(self) -> int:
"""
return 360 if self.is_video else 244

def get_thumbnail_url(self) -> str:
"""Get a thumbnail url for the video."""
def get_thumbnail_url(self, size="x720") -> str:
"""Get a thumbnail url for the video, with defined max size."""
request = None
if self.thumbnail and self.thumbnail.file_exist():
# Do not serve thumbnail url directly, as it can lead to the video URL
im = get_thumbnail(self.thumbnail.file, "x170", crop="center", quality=80)
im = get_thumbnail(self.thumbnail.file, size, crop="center", quality=80)
return im.url
else:
return "".join(
Expand Down

0 comments on commit 062b39e

Please sign in to comment.