2
0
Fork 0
mirror of https://github.com/meisnate12/Plex-Meta-Manager synced 2025-02-24 11:27:20 +00:00

[33] fix version check

This commit is contained in:
meisnate12 2023-11-30 13:25:28 -05:00
parent ef3c65f877
commit 48a2bd9b00
2 changed files with 9 additions and 4 deletions

View file

@ -1 +1 @@
1.19.1-develop32
1.19.1-develop33

View file

@ -237,10 +237,15 @@ def start(attrs):
new_version = latest_version[0] if latest_version and (version[1] != latest_version[1] or (version[2] and version[2] < latest_version[2])) else None
if new_version:
logger.info(f" Newest Version: {new_version}")
with open("requirements.txt", "r") as file:
required_version = next(l.strip()[9:] for l in file.readlines() if l.strip().startswith("PlexAPI=="))
required_version = None
if not is_docker and not is_linuxserver:
try:
with open("requirements.txt", "r") as file:
required_version = next(l.strip()[9:] for l in file.readlines() if l.strip().startswith("PlexAPI=="))
except FileNotFoundError:
logger.error(" File Error: requirements.txt not found")
logger.info(f" PlexAPI Version: {plexapi.VERSION}")
if required_version != plexapi.VERSION:
if required_version is not None and required_version != plexapi.VERSION:
logger.info(f" PlexAPI Requires an Update to Version: {required_version}")
logger.info(f" Platform: {platform.platform()}")
logger.info(f" Memory: {round(psutil.virtual_memory().total / (1024.0 ** 3))} GB")