mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 05:49:24 +02:00
[EPIC] Audio metadata update - UI / API
This commit is contained in:
parent
1a1c62ab37
commit
e0c5ffcb16
59 changed files with 2793 additions and 436 deletions
24
api/funkwhale_api/music/mutations.py
Normal file
24
api/funkwhale_api/music/mutations.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from funkwhale_api.common import mutations
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
def can_suggest(obj, actor):
|
||||
return True
|
||||
|
||||
|
||||
def can_approve(obj, actor):
|
||||
return actor.user and actor.user.get_permissions()["library"]
|
||||
|
||||
|
||||
@mutations.registry.connect(
|
||||
"update",
|
||||
models.Track,
|
||||
perm_checkers={"suggest": can_suggest, "approve": can_approve},
|
||||
)
|
||||
class TrackMutationSerializer(mutations.UpdateMutationSerializer):
|
||||
serialized_relations = {"license": "code"}
|
||||
|
||||
class Meta:
|
||||
model = models.Track
|
||||
fields = ["license", "title", "position"]
|
Loading…
Add table
Add a link
Reference in a new issue