Verified Commit e19fbf54 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Exclude federated files from library endpoint

parent 98381a00
......@@ -121,7 +121,7 @@ class MusicFilesViewSet(FederationMixin, viewsets.GenericViewSet):
qs = TrackFile.objects.order_by('-creation_date').select_related(
'track__artist',
'track__album__artist'
)
).filter(library_track__isnull=True)
if page is None:
conf = {
'id': utils.full_url(reverse('federation:music:files-list')),
......
......@@ -116,6 +116,18 @@ def test_audio_file_list_actor_page(
assert response.status_code == 200
assert response.data == expected
def test_audio_file_list_actor_page_exclude_federated_files(
db, settings, api_client, factories):
settings.FEDERATION_MUSIC_NEEDS_APPROVAL = False
library = actors.SYSTEM_ACTORS['library'].get_actor_instance()
tfs = factories['music.TrackFile'].create_batch(size=5, federation=True)
url = reverse('federation:music:files-list')
response = api_client.get(url)
assert response.status_code == 200
assert response.data['totalItems'] == 0
def test_audio_file_list_actor_page_error(
db, settings, api_client, factories):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment