mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 21:09:48 +02:00
See #170: add a description field on tracks, albums, tracks
This commit is contained in:
parent
424b9f133a
commit
2bc71eecfd
38 changed files with 653 additions and 59 deletions
|
@ -143,6 +143,11 @@ class ArtistViewSet(
|
|||
obj = refetch_obj(obj, self.get_queryset())
|
||||
return obj
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
albums = models.Album.objects.with_tracks_count().select_related(
|
||||
|
@ -194,6 +199,11 @@ class AlbumViewSet(
|
|||
obj = refetch_obj(obj, self.get_queryset())
|
||||
return obj
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
tracks = (
|
||||
|
@ -332,6 +342,11 @@ class TrackViewSet(
|
|||
get_libraries(filter_uploads=lambda o, uploads: uploads.filter(track=o))
|
||||
)
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
|
||||
def strip_absolute_media_url(path):
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue