From 519e856b1477d3cad4da620ab9441aff86042ea7 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Sat, 20 Apr 2024 13:50:54 +0200 Subject: 🛠️ Values for options passed via command line will be converted to int if necessary. Fixes #83 Settings save fix after refactoring to `StrEnum`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/config.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tidal_dl_ng/config.py') diff --git a/tidal_dl_ng/config.py b/tidal_dl_ng/config.py index 165bdc5..647ed7d 100644 --- a/tidal_dl_ng/config.py +++ b/tidal_dl_ng/config.py @@ -34,6 +34,11 @@ class BaseConfig: f.write(data_json) def set_option(self, key: str, value: Any) -> None: + tmp_data: Any = getattr(self.data, key) + + if isinstance(tmp_data, int) and not isinstance(value, int): + value = int(value) + setattr(self.data, key, value) def read(self, path: str) -> bool: -- cgit v1.3.1