mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 00:49:16 +02:00
See #170: Funkwhale federation
This commit is contained in:
parent
fce4d87551
commit
9aa12db62e
20 changed files with 3722 additions and 125 deletions
|
@ -241,6 +241,14 @@ class AlbumViewSet(
|
|||
return serializers.AlbumCreateSerializer
|
||||
return super().get_serializer_class()
|
||||
|
||||
@transaction.atomic
|
||||
def perform_destroy(self, instance):
|
||||
routes.outbox.dispatch(
|
||||
{"type": "Delete", "object": {"type": "Album"}},
|
||||
context={"album": instance},
|
||||
)
|
||||
models.Album.objects.filter(pk=instance.pk).delete()
|
||||
|
||||
|
||||
class LibraryViewSet(
|
||||
mixins.CreateModelMixin,
|
||||
|
@ -380,6 +388,15 @@ class TrackViewSet(
|
|||
context["description"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
@transaction.atomic
|
||||
def perform_destroy(self, instance):
|
||||
uploads = instance.uploads.order_by("id")
|
||||
routes.outbox.dispatch(
|
||||
{"type": "Delete", "object": {"type": "Audio"}},
|
||||
context={"uploads": list(uploads)},
|
||||
)
|
||||
instance.delete()
|
||||
|
||||
|
||||
def strip_absolute_media_url(path):
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue