mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 09:49:55 +02:00
Resolve "Hide an artist in the UI"
This commit is contained in:
parent
d4d4e60e39
commit
bdf83bd8ff
50 changed files with 1051 additions and 49 deletions
12
api/funkwhale_api/history/filters.py
Normal file
12
api/funkwhale_api/history/filters.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from funkwhale_api.moderation import filters as moderation_filters
|
||||
|
||||
from . import models
|
||||
|
||||
|
||||
class ListeningFilter(moderation_filters.HiddenContentFilterSet):
|
||||
class Meta:
|
||||
model = models.Listening
|
||||
hidden_content_fields_mapping = moderation_filters.USER_FILTER_CONFIG[
|
||||
"LISTENING"
|
||||
]
|
||||
fields = ["hidden"]
|
|
@ -7,7 +7,7 @@ from funkwhale_api.activity import record
|
|||
from funkwhale_api.common import fields, permissions
|
||||
from funkwhale_api.music.models import Track
|
||||
from funkwhale_api.music import utils as music_utils
|
||||
from . import models, serializers
|
||||
from . import filters, models, serializers
|
||||
|
||||
|
||||
class ListeningViewSet(
|
||||
|
@ -25,6 +25,7 @@ class ListeningViewSet(
|
|||
IsAuthenticatedOrReadOnly,
|
||||
]
|
||||
owner_checks = ["write"]
|
||||
filterset_class = filters.ListeningFilter
|
||||
|
||||
def get_serializer_class(self):
|
||||
if self.request.method.lower() in ["head", "get", "options"]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue