From 48a2bd9b004c5362fbbf225245f5dc92e76fff9e Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 30 Nov 2023 13:25:28 -0500 Subject: [PATCH] [33] fix version check --- VERSION | 2 +- plex_meta_manager.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 4652cf65..27a30319 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.19.1-develop32 +1.19.1-develop33 diff --git a/plex_meta_manager.py b/plex_meta_manager.py index d99cc49d..42ddaaa8 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -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")