From 0d7351994633b55f874b5c81255b62baf11ba4fc Mon Sep 17 00:00:00 2001 From: tcely Date: Sat, 22 Feb 2025 14:45:53 -0500 Subject: [PATCH] Fix an internal server error --- tubesync/sync/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tubesync/sync/views.py b/tubesync/sync/views.py index 2a9ce8b5..e9499bea 100644 --- a/tubesync/sync/views.py +++ b/tubesync/sync/views.py @@ -495,8 +495,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