diff --git a/api/funkwhale_api/common/schema.yml b/api/funkwhale_api/common/schema.yml
index 3dd623900..9970d42fd 100644
--- a/api/funkwhale_api/common/schema.yml
+++ b/api/funkwhale_api/common/schema.yml
@@ -1,7 +1,7 @@
openapi: 3.0.3
info:
title: Funkwhale API
- version: 1.4.0
+ version: 2.0.0a1
description: |
# Funkwhale API
diff --git a/api/funkwhale_api/playlists/views.py b/api/funkwhale_api/playlists/views.py
index 03e5e378d..18bcaa2a2 100644
--- a/api/funkwhale_api/playlists/views.py
+++ b/api/funkwhale_api/playlists/views.py
@@ -7,6 +7,7 @@ from django.db.models import Count
from drf_spectacular.utils import extend_schema
from rest_framework import exceptions, mixins, status, viewsets
from rest_framework.decorators import action
+from rest_framework.pagination import PageNumberPagination
from rest_framework.parsers import FormParser, JSONParser, MultiPartParser
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
@@ -138,9 +139,15 @@ class PlaylistViewSet(
plugins.TRIGGER_THIRD_PARTY_UPLOAD,
track=plt.track,
)
- serializer = serializers.PlaylistTrackSerializer(plts, many=True)
- data = {"count": len(plts), "results": serializer.data}
- return Response(data, status=200)
+
+ # Apply pagination
+ paginator = PageNumberPagination()
+ paginator.page_size = 100 # Set the page size (number of items per page)
+ paginated_plts = paginator.paginate_queryset(plts, request)
+
+ # Serialize the paginated data
+ serializer = serializers.PlaylistTrackSerializer(paginated_plts, many=True)
+ return paginator.get_paginated_response(serializer.data)
@extend_schema(
operation_id="add_to_playlist", request=serializers.PlaylistAddManySerializer
diff --git a/front/src/components/audio/track/MobileRow.vue b/front/src/components/audio/track/MobileRow.vue
index 39494a996..0bf47794b 100644
--- a/front/src/components/audio/track/MobileRow.vue
+++ b/front/src/components/audio/track/MobileRow.vue
@@ -2,7 +2,7 @@
import type { Track, Artist, Album, Playlist, Library, Channel, Actor } from '~/types'
import type { PlayOptionsProps } from '~/composables/audio/usePlayOptions'
-import { ref, computed } from 'vue'
+import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
import { usePlayer } from '~/composables/audio/player'
@@ -12,9 +12,10 @@ import { useStore } from '~/store'
import usePlayOptions from '~/composables/audio/usePlayOptions'
import TrackFavoriteIcon from '~/components/favorites/TrackFavoriteIcon.vue'
-import TrackModal from '~/components/audio/track/Modal.vue'
import { generateTrackCreditString } from '~/utils/utils'
+import Button from '~/components/ui/Button.vue'
+
interface Props extends PlayOptionsProps {
track: Track
index: number
@@ -25,7 +26,6 @@ interface Props extends PlayOptionsProps {
// TODO(wvffle): Remove after https://github.com/vuejs/core/pull/4512 is merged
isPlayable?: boolean
- tracks?: Track[]
artist?: Artist | null
album?: Album | null
playlist?: Playlist | null
@@ -39,7 +39,6 @@ const props = withDefaults(defineProps