Skip to content

Commit fbc16ab

Browse files
committed
Logo tweaks
1 parent 56e75e7 commit fbc16ab

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Plex/grab-all-posters.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from logs import blogger, logger, plogger, setup_logger
2121
from pathvalidate import sanitize_filename
2222
from 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
@@ -78,6 +79,7 @@
7879
SCRIPT_NAME = Path(__file__).stem
7980

8081
VERSION = "0.9.0"
82+
MIN_PLEXAPI_VERSION = "4.16.1"
8183

8284
config = Config('../config.yaml')
8385

@@ -104,6 +106,14 @@ def superchat(msg, level, logfile):
104106

105107
plogger(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+
107117
ID_FILES = True
108118

109119
URL_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(

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
alive-progress==2.4.1
22
imdbpy
33
pathvalidate
4-
PlexAPI
4+
PlexAPI>=4.16.1
55
pre-commit
66
pyopenssl
77
python-dotenv
@@ -18,7 +18,6 @@ sqlalchemy<2.0
1818
tabulate
1919
validators
2020
pillow
21-
2221
Flask
2322
GitPython
2423
num2words

0 commit comments

Comments
 (0)