From adf3d4377f83fbad975c334deadc4ec738eccf8f Mon Sep 17 00:00:00 2001 From: Markos Gogoulos Date: Mon, 26 Apr 2021 16:32:18 +0300 Subject: [PATCH] allow media of all states to be added to playlist (#154) --- files/models.py | 2 +- files/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/files/models.py b/files/models.py index dec779c7..41b3bf6c 100644 --- a/files/models.py +++ b/files/models.py @@ -1386,7 +1386,7 @@ class Playlist(models.Model): @property def thumbnail_url(self): pm = self.playlistmedia_set.first() - if pm: + if pm and pm.media.thumbnail: return helpers.url_from_path(pm.media.thumbnail.path) return None diff --git a/files/views.py b/files/views.py index 49836412..d693d915 100644 --- a/files/views.py +++ b/files/views.py @@ -896,7 +896,7 @@ class PlaylistDetail(APIView): if action in ["add", "remove", "ordering"]: media = Media.objects.filter( - friendly_token=media_friendly_token, state="public" + friendly_token=media_friendly_token ).first() if media: if action == "add":