|
|
@ -1,5 +1,6 @@ |
|
|
from rest_framework import generics, status |
|
|
from rest_framework import generics, status |
|
|
from rest_framework.response import Response |
|
|
from rest_framework.response import Response |
|
|
|
|
|
from rest_framework.authentication import TokenAuthentication |
|
|
from drf_yasg import openapi |
|
|
from drf_yasg import openapi |
|
|
from drf_yasg.utils import swagger_auto_schema |
|
|
from drf_yasg.utils import swagger_auto_schema |
|
|
from apps.library.pagination import NoPagination |
|
|
from apps.library.pagination import NoPagination |
|
|
@ -40,6 +41,7 @@ class PodcastCategoryListAPIView(generics.ListAPIView): |
|
|
class PinnedPodcastCollectionListView(generics.ListAPIView): |
|
|
class PinnedPodcastCollectionListView(generics.ListAPIView): |
|
|
serializer_class = PinnedPodcastCollectionSerializer |
|
|
serializer_class = PinnedPodcastCollectionSerializer |
|
|
permission_classes = (IsAuthenticated,) |
|
|
permission_classes = (IsAuthenticated,) |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
pagination_class = NoPagination |
|
|
pagination_class = NoPagination |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
@ -89,6 +91,7 @@ class PinnedPodcastCollectionListView(generics.ListAPIView): |
|
|
class MiddlePodcastCollectionListView(generics.ListAPIView): |
|
|
class MiddlePodcastCollectionListView(generics.ListAPIView): |
|
|
serializer_class = MiddlePodcastCollectionSerializer |
|
|
serializer_class = MiddlePodcastCollectionSerializer |
|
|
permission_classes = (IsAuthenticated,) |
|
|
permission_classes = (IsAuthenticated,) |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
pagination_class = NoPagination |
|
|
pagination_class = NoPagination |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
@ -117,6 +120,7 @@ class PodcastListAPIView(generics.ListAPIView): |
|
|
""" |
|
|
""" |
|
|
serializer_class = PodcastPlaylistListSerializer |
|
|
serializer_class = PodcastPlaylistListSerializer |
|
|
permission_classes = (IsAuthenticated,) |
|
|
permission_classes = (IsAuthenticated,) |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
pagination_class = StandardResultsSetPagination |
|
|
pagination_class = StandardResultsSetPagination |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
@ -226,6 +230,7 @@ class PodcastDetailAPIView(generics.RetrieveAPIView): |
|
|
serializer_class = PodcastPlaylistDetailSerializer |
|
|
serializer_class = PodcastPlaylistDetailSerializer |
|
|
lookup_field = 'slug' |
|
|
lookup_field = 'slug' |
|
|
permission_classes = (IsAuthenticated,) |
|
|
permission_classes = (IsAuthenticated,) |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
operation_description="Get podcast playlist details by slug", |
|
|
operation_description="Get podcast playlist details by slug", |
|
|
@ -256,6 +261,7 @@ class UserPlaylistListAPIView(generics.ListAPIView): |
|
|
""" |
|
|
""" |
|
|
serializer_class = PodcastListSerializer |
|
|
serializer_class = PodcastListSerializer |
|
|
permission_classes = (IsAuthenticated,) |
|
|
permission_classes = (IsAuthenticated,) |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
pagination_class = StandardResultsSetPagination |
|
|
pagination_class = StandardResultsSetPagination |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
@ -290,6 +296,7 @@ class UserPlaylistCreateAPIView(generics.CreateAPIView): |
|
|
""" |
|
|
""" |
|
|
serializer_class = UserPlaylistCreateSerializer |
|
|
serializer_class = UserPlaylistCreateSerializer |
|
|
permission_classes = (IsAuthenticated,) |
|
|
permission_classes = (IsAuthenticated,) |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
operation_description="Add or update a podcast in the user's personal playlist", |
|
|
operation_description="Add or update a podcast in the user's personal playlist", |
|
|
|