mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-22 21:16:38 +00:00
Merge pull request #763 from tcely/patch-16
Fix an internal server error
This commit is contained in:
commit
e7032dccf0
@ -499,8 +499,9 @@ class MediaThumbView(DetailView):
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
media = self.get_object()
|
||||
if media.thumb:
|
||||
thumb = open(media.thumb.path, 'rb').read()
|
||||
if media.thumb_file_exists:
|
||||
thumb_path = pathlib.Path(media.thumb.path)
|
||||
thumb = thumb_path.read_bytes()
|
||||
content_type = 'image/jpeg'
|
||||
else:
|
||||
# No thumbnail on disk, return a blank 1x1 gif
|
||||
|
Loading…
Reference in New Issue
Block a user