Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip writing legacy env keys to .env #1868

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading