Browse Source

allow media of all states to be added to playlist (#154)

Markos Gogoulos 4 năm trước cách đây
mục cha
commit
adf3d4377f
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      files/models.py
  2. 1 1
      files/views.py

+ 1 - 1
files/models.py

@@ -1386,7 +1386,7 @@ class Playlist(models.Model):
     @property
     @property
     def thumbnail_url(self):
     def thumbnail_url(self):
         pm = self.playlistmedia_set.first()
         pm = self.playlistmedia_set.first()
-        if pm:
+        if pm and pm.media.thumbnail:
             return helpers.url_from_path(pm.media.thumbnail.path)
             return helpers.url_from_path(pm.media.thumbnail.path)
         return None
         return None
 
 

+ 1 - 1
files/views.py

@@ -896,7 +896,7 @@ class PlaylistDetail(APIView):
 
 
         if action in ["add", "remove", "ordering"]:
         if action in ["add", "remove", "ordering"]:
             media = Media.objects.filter(
             media = Media.objects.filter(
-                friendly_token=media_friendly_token, state="public"
+                friendly_token=media_friendly_token
             ).first()
             ).first()
             if media:
             if media:
                 if action == "add":
                 if action == "add":