Skip to content

Commit

Permalink
Merge pull request #1868 from glensc/skip-legacy.env
Browse files Browse the repository at this point in the history
Skip writing legacy env keys to .env
  • Loading branch information
glensc authored Mar 17, 2024
2 parents 044ca3d + f307cda commit 2ba1fb7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions plextraktsync/config/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Config(ChangeNotifier, ConfigMergeMixin, dict):
# This is stored/used only if user uses a shared PMS.
# Needed to fetch its watchlist from Plex online servers.
"PLEX_ACCOUNT_TOKEN": True,
# Old keys, Leave comment why deprecated
"PLEX_FALLBACKURL": "Legacy, used before 0.18.21",
"PLEX_BASEURL": "Unused after 0.24.0, moved to servers.yml",
"PLEX_LOCALURL": "Unused after 0.24.0, moved to servers.yml",
"PLEX_TOKEN": "Unused after 0.24.0, moved to servers.yml",
# Old keys, Do not write to .env anymore
"PLEX_FALLBACKURL": False,
"PLEX_BASEURL": False,
"PLEX_LOCALURL": False,
"PLEX_TOKEN": False,
}

initialized = False
Expand Down Expand Up @@ -157,6 +157,10 @@ def save(self):
with open(self.env_file, "w") as txt:
txt.write("# This is .env file for PlexTraktSync\n")
for key, value in self.env_keys.items():
if value is False:
# Skip the item
continue

if value is not True:
# Include deprecation message
txt.write(f"# {key}: {value}\n")
Expand Down

0 comments on commit 2ba1fb7

Please sign in to comment.