From 1271b30d64b1e1ad7fa759081532988b5417695b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alban=20F=C3=A9ron?= Date: Sat, 1 Jun 2024 17:45:54 +0200 Subject: [PATCH] We do support POST requests --- supysonic/api/extensions.py | 3 ++- supysonic/api/formatters.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/supysonic/api/extensions.py b/supysonic/api/extensions.py index 4b1f505..ee2c307 100644 --- a/supysonic/api/extensions.py +++ b/supysonic/api/extensions.py @@ -13,4 +13,5 @@ @api_routing("/getOpenSubsonicExtensions") def extensions(): - return request.formatter("openSubsonicExtensions", []) + extensions = [{"name": "formPost", "versions": [1]}] + return request.formatter("openSubsonicExtensions", extensions) diff --git a/supysonic/api/formatters.py b/supysonic/api/formatters.py index 7ac5073..5d90609 100644 --- a/supysonic/api/formatters.py +++ b/supysonic/api/formatters.py @@ -32,7 +32,7 @@ def __call__(self, *args, **kwargs): class JSONBaseFormatter(BaseFormatter): def __remove_empty_lists(self, d): if not isinstance(d, dict): - raise TypeError("Expecting a dict got " + type(d).__name__) + return d keys_to_remove = [] for key, value in d.items():