Skip to content

Commit

Permalink
Merge pull request #1228 from Badatos/bugfix_thumbnail-size
Browse files Browse the repository at this point in the history
Correct default thumbnail size to avoid thumbnail quality downgrade
  • Loading branch information
Badatos authored Nov 25, 2024
2 parents c1692ca + 3903379 commit 3e34f08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pod/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
##
# Version of the project
#
VERSION = "3.8.2"
VERSION = "3.8.3"

##
# Installed applications list
Expand Down
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 3e34f08

Please sign in to comment.