diff options
| author | Robert Honz <exislow+github@gmail.com> | 2024-04-20 13:50:54 +0200 |
|---|---|---|
| committer | Robert Honz <exislow+github@gmail.com> | 2024-04-20 13:50:54 +0200 |
| commit | 519e856b1477d3cad4da620ab9441aff86042ea7 (patch) | |
| tree | 604530b4ff2bd1bc98b52cf4abbcd3249bc32488 /tidal_dl_ng/config.py | |
| parent | b972ec01b696267653aaa753e15995cd5b4af720 (diff) | |
| download | tidal-dl-ng-519e856b1477d3cad4da620ab9441aff86042ea7.tar.gz | |
🛠️ Values for options passed via command line will be converted to int if necessary. Fixes #83
Settings save fix after refactoring to `StrEnum`.
Diffstat (limited to 'tidal_dl_ng/config.py')
| -rw-r--r-- | tidal_dl_ng/config.py | 5 |
1 files changed, 5 insertions, 0 deletions
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: |
