OpenSubsonic: report HTTP form POST extension as supported
Funkwhale already supports passing parameters as application/x-www-form-urlencoded Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2695>
This commit is contained in:
parent
bf8f1e41b9
commit
d227490f5b
|
@ -189,8 +189,7 @@ class SubsonicViewSet(viewsets.GenericViewSet):
|
||||||
)
|
)
|
||||||
def get_open_subsonic_extensions(self, request, *args, **kwargs):
|
def get_open_subsonic_extensions(self, request, *args, **kwargs):
|
||||||
data = {
|
data = {
|
||||||
# No specific extensions are currently supported
|
"openSubsonicExtensions": [{"name": "formPost", "versions": [1]}],
|
||||||
"openSubsonicExtensions": [""],
|
|
||||||
}
|
}
|
||||||
return response.Response(data, status=200)
|
return response.Response(data, status=200)
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,23 @@ def test_ping(f, db, api_client):
|
||||||
assert response.data == expected
|
assert response.data == expected
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("f", ["xml", "json"])
|
||||||
|
def test_get_open_subsonic_extensions(f, db, api_client):
|
||||||
|
url = reverse("api:subsonic:subsonic-get_open_subsonic_extensions")
|
||||||
|
response = api_client.get(url, {"f": f})
|
||||||
|
|
||||||
|
expected = {
|
||||||
|
"openSubsonicExtensions": [
|
||||||
|
{
|
||||||
|
"name": "formPost",
|
||||||
|
"versions": [1],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
assert response.status_code == 200
|
||||||
|
assert response.data == expected
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("f", ["json"])
|
@pytest.mark.parametrize("f", ["json"])
|
||||||
def test_get_artists(
|
def test_get_artists(
|
||||||
f, db, logged_in_api_client, factories, mocker, queryset_equal_queries
|
f, db, logged_in_api_client, factories, mocker, queryset_equal_queries
|
||||||
|
|
Loading…
Reference in New Issue