From: jozefKruszynski <60214390+jozefKruszynski@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:27:18 +0000 (+0200) Subject: Fix remove playlist tracks (#594) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=a4279fdeb3cd45e9a15dd96c3e4b63f1fb5f2e8d;p=music-assistant-server.git 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 --- 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]