mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 04:29:23 +02:00
Plugins infrastructure
This commit is contained in:
parent
9964adfbf6
commit
d4028450a9
32 changed files with 1560 additions and 47 deletions
|
@ -2,6 +2,8 @@ from rest_framework import mixins, viewsets
|
|||
|
||||
from django.db.models import Prefetch
|
||||
|
||||
from config import plugins
|
||||
|
||||
from funkwhale_api.activity import record
|
||||
from funkwhale_api.common import fields, permissions
|
||||
from funkwhale_api.music.models import Track
|
||||
|
@ -39,6 +41,11 @@ class ListeningViewSet(
|
|||
|
||||
def perform_create(self, serializer):
|
||||
r = super().perform_create(serializer)
|
||||
plugins.trigger_hook(
|
||||
plugins.LISTENING_CREATED,
|
||||
listening=serializer.instance,
|
||||
confs=plugins.get_confs(self.request.user),
|
||||
)
|
||||
record.send(serializer.instance)
|
||||
return r
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue