summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tidal_dl_ng/config.py')
-rw-r--r--tidal_dl_ng/config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py
index 7b86f1c..112ff8c 100644
--- a/tidal_dl_ng/config.py
+++ b/tidal_dl_ng/config.py
@@ -34,9 +34,11 @@ class BaseConfig:
f.write(data_json)
def set_option(self, key: str, value: Any) -> None:
- tmp_data: Any = getattr(self.data, key)
+ value_old: Any = getattr(self.data, key)
- if isinstance(tmp_data, int) and not isinstance(value, int):
+ if type(value_old) == bool: # noqa: E721
+ value = True if value.lower() in ("true", "1", "yes", "y") else False # noqa: SIM210
+ elif type(value_old) == int and type(value) != int: # noqa: E721
value = int(value)
setattr(self.data, key, value)