2020from logs import blogger , logger , plogger , setup_logger
2121from pathvalidate import sanitize_filename
2222from plexapi .utils import download
23+ import plexapi
2324
2425# TODO: lib_stats[lib_key] = item_count in sqlite
2526# TODO: Track Collection status in sqlite with guid
7879SCRIPT_NAME = Path (__file__ ).stem
7980
8081VERSION = "0.9.0"
82+ MIN_PLEXAPI_VERSION = "4.16.1"
8183
8284config = Config ('../config.yaml' )
8385
@@ -104,6 +106,14 @@ def superchat(msg, level, logfile):
104106
105107plogger (f"Starting { SCRIPT_NAME } { VERSION } at { RUNTIME_STR } " , "info" , "a" )
106108
109+ if plexapi .__version__ < MIN_PLEXAPI_VERSION :
110+ plogger (f"This script requires PlexAPI { MIN_PLEXAPI_VERSION } or later. You have { plexapi .__version__ } ." , "error" , "a" )
111+ plogger (f"Please update the requirements. Exiting..." , "error" , "a" )
112+ exit ()
113+ else :
114+ plogger (f"Running under PlexAPI { plexapi .__version__ } ." , "info" , "a" )
115+
116+
107117ID_FILES = True
108118
109119URL_ARRAY = []
@@ -1271,8 +1281,9 @@ def get_posters(lib, item, uuid, title):
12711281 if config .get_bool ('image_download.what_to_grab.backgrounds' , True ):
12721282 get_art (item , artwork_path , tmid , tvid , uuid , lib_title )
12731283
1274- if config .get_bool ('image_download.what_to_grab.logos' , True ):
1275- get_logo (item , artwork_path , tmid , tvid , uuid , lib_title )
1284+ if not item .TYPE == "collection" :
1285+ if config .get_bool ('image_download.what_to_grab.logos' , True ):
1286+ get_logo (item , artwork_path , tmid , tvid , uuid , lib_title )
12761287
12771288 else :
12781289 plogger (
0 commit comments