From a4279fdeb3cd45e9a15dd96c3e4b63f1fb5f2e8d Mon Sep 17 00:00:00 2001 From: jozefKruszynski <60214390+jozefKruszynski@users.noreply.github.com> Date: Wed, 29 Mar 2023 20:27:18 +0200 Subject: [PATCH] Fix remove playlist tracks (#594) * fix: playlists Fix GenericAlias error when trying to remove playlist tracks * fix: playlists Update according to review comment * fix review comment * Fixing review comment --------- Co-authored-by: jkruszynski --- music_assistant/server/helpers/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/music_assistant/server/helpers/api.py b/music_assistant/server/helpers/api.py index 15332534..6731b5c8 100644 --- a/music_assistant/server/helpers/api.py +++ b/music_assistant/server/helpers/api.py @@ -93,12 +93,12 @@ def parse_value(name: str, value: Any, value_type: Any, default: Any = MISSING) if value is None and value_type is NoneType: return None origin = get_origin(value_type) - if origin is list: - return [ + if origin in (tuple, list): + return origin( parse_value(name, subvalue, get_args(value_type)[0]) for subvalue in value if subvalue is not None - ] + ) elif origin is dict: subkey_type = get_args(value_type)[0] subvalue_type = get_args(value_type)[1] -- 2.34.1