display PlexAPI version

This commit is contained in:
Chaz Larson 2023-09-18 10:59:36 -05:00 committed by GitHub
parent f47a7005cf
commit 949e9ca4f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ from collections import Counter
from concurrent.futures import ProcessPoolExecutor from concurrent.futures import ProcessPoolExecutor
from datetime import datetime from datetime import datetime
from modules.logs import MyLogger from modules.logs import MyLogger
import importlib.metadata
if sys.version_info[0] != 3 or sys.version_info[1] < 8: if sys.version_info[0] != 3 or sys.version_info[1] < 8:
print("Version Error: Version: %s.%s.%s incompatible please use Python 3.8+" % (sys.version_info[0], sys.version_info[1], sys.version_info[2])) print("Version Error: Version: %s.%s.%s incompatible please use Python 3.8+" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]))
@ -110,6 +111,7 @@ for arg_key, arg_data in arguments.items():
env_version = get_env("BRANCH_NAME", "master") env_version = get_env("BRANCH_NAME", "master")
is_docker = get_env("PMM_DOCKER", False, arg_bool=True) is_docker = get_env("PMM_DOCKER", False, arg_bool=True)
is_linuxserver = get_env("PMM_LINUXSERVER", False, arg_bool=True) is_linuxserver = get_env("PMM_LINUXSERVER", False, arg_bool=True)
plexapi_version = importlib.metadata.version('PlexAPI')
secret_args = {} secret_args = {}
plex_url = None plex_url = None
@ -238,6 +240,7 @@ 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 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: if new_version:
logger.info(f" Newest Version: {new_version}") logger.info(f" Newest Version: {new_version}")
logger.info(f" PlexAPI library version: {plexapi_version}")
logger.info(f" Platform: {platform.platform()}") logger.info(f" Platform: {platform.platform()}")
logger.info(f" Memory: {round(psutil.virtual_memory().total / (1024.0 ** 3))} GB") logger.info(f" Memory: {round(psutil.virtual_memory().total / (1024.0 ** 3))} GB")
if "time" in attrs and attrs["time"]: start_type = f"{attrs['time']} " if "time" in attrs and attrs["time"]: start_type = f"{attrs['time']} "