fix(api): openSubsonic not returning as boolean NOCHANGELOG
This commit is contained in:
parent
0bf217dbcd
commit
611631213a
|
@ -42,7 +42,7 @@ def structure_payload(data):
|
|||
"status": "ok",
|
||||
"type": "funkwhale",
|
||||
"version": "1.16.0",
|
||||
"openSubsonic": "true",
|
||||
"openSubsonic": True,
|
||||
}
|
||||
payload.update(data)
|
||||
if "detail" in payload:
|
||||
|
@ -70,6 +70,7 @@ class SubsonicXMLRenderer(renderers.JSONRenderer):
|
|||
return super().render(data, accepted_media_type, renderer_context)
|
||||
final = structure_payload(data)
|
||||
final["xmlns"] = "http://subsonic.org/restapi"
|
||||
final["openSubsonic"] = "true"
|
||||
tree = dict_to_xml_tree("subsonic-response", final)
|
||||
return b'<?xml version="1.0" encoding="UTF-8"?>\n' + ET.tostring(
|
||||
tree, encoding="utf-8"
|
||||
|
|
|
@ -18,7 +18,7 @@ from funkwhale_api.subsonic import renderers
|
|||
"type": "funkwhale",
|
||||
"funkwhaleVersion": funkwhale_api.__version__,
|
||||
"serverVersion": funkwhale_api.__version__,
|
||||
"openSubsonic": "true",
|
||||
"openSubsonic": True,
|
||||
"hello": "world",
|
||||
},
|
||||
),
|
||||
|
@ -33,7 +33,7 @@ from funkwhale_api.subsonic import renderers
|
|||
"type": "funkwhale",
|
||||
"funkwhaleVersion": funkwhale_api.__version__,
|
||||
"serverVersion": funkwhale_api.__version__,
|
||||
"openSubsonic": "true",
|
||||
"openSubsonic": True,
|
||||
"hello": "world",
|
||||
"error": {"code": 10, "message": "something went wrong"},
|
||||
},
|
||||
|
@ -46,7 +46,7 @@ from funkwhale_api.subsonic import renderers
|
|||
"type": "funkwhale",
|
||||
"funkwhaleVersion": funkwhale_api.__version__,
|
||||
"serverVersion": funkwhale_api.__version__,
|
||||
"openSubsonic": "true",
|
||||
"openSubsonic": True,
|
||||
"hello": "world",
|
||||
"error": {"code": 0, "message": "something went wrong"},
|
||||
},
|
||||
|
@ -66,7 +66,7 @@ def test_json_renderer():
|
|||
"type": "funkwhale",
|
||||
"funkwhaleVersion": funkwhale_api.__version__,
|
||||
"serverVersion": funkwhale_api.__version__,
|
||||
"openSubsonic": "true",
|
||||
"openSubsonic": True,
|
||||
"hello": "world",
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue