@ -9,8 +9,8 @@ if sys.version_info[0] != 3 or sys.version_info[1] < 8:
sys . exit ( 0 )
sys . exit ( 0 )
try :
try :
import plexapi, psutil , requests, schedule
import arrapi, git , lxml , pathvalidate , PIL , plexapi, psutil , dateutil, requests, ruamel . yaml , schedule , setuptools , tmdbapis
from dotenv import load_dotenv
from dotenv import load_dotenv , version as dotenv_version
from PIL import ImageFile
from PIL import ImageFile
from plexapi import server
from plexapi import server
from plexapi . exceptions import NotFound
from plexapi . exceptions import NotFound
@ -19,6 +19,22 @@ except (ModuleNotFoundError, ImportError):
print ( " Requirements Error: Requirements are not installed " )
print ( " Requirements Error: Requirements are not installed " )
sys . exit ( 0 )
sys . exit ( 0 )
system_versions = {
" arrapi " : arrapi . __version__ ,
" GitPython " : git . __version__ ,
" lxml " : lxml . __version__ ,
" pathvalidate " : pathvalidate . __version__ ,
" pillow " : PIL . __version__ ,
" PlexAPI " : plexapi . __version__ ,
" psutil " : psutil . __version__ ,
" python-dotenv " : dotenv_version . __version__ ,
" python-dateutil " : dateutil . __version__ , # noqa
" requests " : requests . __version__ ,
" ruamel.yaml " : ruamel . yaml . __version__ ,
" setuptools " : setuptools . __version__ ,
" tmdbapis " : tmdbapis . __version__
}
default_dir = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , " config " )
default_dir = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , " config " )
load_dotenv ( os . path . join ( default_dir , " .env " ) )
load_dotenv ( os . path . join ( default_dir , " .env " ) )
@ -257,18 +273,17 @@ 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 } " )
required_version = None
logger . info ( f " Platform: { platform . platform ( ) } " )
logger . info ( f " Memory: { round ( psutil . virtual_memory ( ) . total / ( 1024.0 * * 3 ) ) } GB " )
if not is_docker and not is_linuxserver :
if not is_docker and not is_linuxserver :
try :
try :
with open ( os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , " requirements.txt " ) ) , " r " ) as file :
with open ( os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , " requirements.txt " ) ) , " r " ) as file :
required_version = next ( ln . strip ( ) [ 9 : ] for ln in file . readlines ( ) if ln . strip ( ) . startswith ( " PlexAPI== " ) )
required_versions = { ln . split ( " == " ) [ 0 ] : ln . split ( " == " ) [ 1 ] . strip ( ) for ln in file . readlines ( ) }
for req_name , sys_ver in system_versions . items ( ) :
if sys_ver != required_versions [ req_name ] :
logger . info ( f " { req_name } version: { sys_ver } requires an update to: { required_versions [ req_name ] } " )
except FileNotFoundError :
except FileNotFoundError :
logger . error ( " File Error: requirements.txt not found " )
logger . error ( " File Error: requirements.txt not found " )
logger . info ( f " PlexAPI 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 " )
if " time " in attrs and attrs [ " time " ] : start_type = f " { attrs [ ' time ' ] } "
if " time " in attrs and attrs [ " time " ] : start_type = f " { attrs [ ' time ' ] } "
elif run_args [ " tests " ] : start_type = " Test "
elif run_args [ " tests " ] : start_type = " Test "
elif " collections " in attrs and attrs [ " collections " ] : start_type = " Collections "
elif " collections " in attrs and attrs [ " collections " ] : start_type = " Collections "