From b09f0dc366efccddab9f5d7c7f04b9e385c8721f Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Mon, 27 Dec 2021 19:01:43 -0500 Subject: [PATCH] fix trakt not saving authorization --- modules/config.py | 2 +- modules/mal.py | 2 +- modules/trakt.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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"] = {