diff --git a/modules/config.py b/modules/config.py index 5951b037..e6cf4cac 100644 --- a/modules/config.py +++ b/modules/config.py @@ -124,7 +124,7 @@ class ConfigFile: if "sonarr" in new_config: new_config["sonarr"] = new_config.pop("sonarr") if "trakt" in new_config: new_config["trakt"] = new_config.pop("trakt") if "mal" in new_config: new_config["mal"] = new_config.pop("mal") - if not read_only: + if not self.read_only: yaml.round_trip_dump(new_config, open(self.config_path, "w", encoding="utf-8"), indent=None, block_seq_indent=2) self.data = new_config except yaml.scanner.ScannerError as e: diff --git a/modules/mal.py b/modules/mal.py index a9c5f8fb..47b1cc30 100644 --- a/modules/mal.py +++ b/modules/mal.py @@ -108,7 +108,7 @@ class MyAnimeList: def _save(self, authorization): if authorization is not None and "access_token" in authorization and authorization["access_token"] and self._check(authorization): - if self.authorization != authorization and self.config.read_only: + if self.authorization != authorization and not self.config.read_only: yaml.YAML().allow_duplicate_keys = True config, ind, bsi = yaml.util.load_yaml_guess_indent(open(self.config_path)) config["mal"]["authorization"] = { diff --git a/modules/trakt.py b/modules/trakt.py index 344f52ce..c3e0cf0c 100644 --- a/modules/trakt.py +++ b/modules/trakt.py @@ -80,7 +80,7 @@ class Trakt: def _save(self, authorization): if authorization and self._check(authorization): - if self.authorization != authorization and self.config.read_only: + if self.authorization != authorization and not self.config.read_only: yaml.YAML().allow_duplicate_keys = True config, ind, bsi = yaml.util.load_yaml_guess_indent(open(self.config_path)) config["trakt"]["authorization"] = {