From ab8b4b365cfcfd60b30950e93a590b43bd02267d Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Sat, 22 Jul 2023 04:42:09 +0000 Subject: [PATCH] Extract file name; re.match only checks the start --- modules/plex.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/plex.py b/modules/plex.py index 7533ae6ae..b25589252 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -3,6 +3,7 @@ from modules import builder, util from modules.library import Library from modules.util import Failed, ImageData +from pathlib import Path from PIL import Image from plexapi import utils from plexapi.audio import Artist, Track, Album @@ -1384,7 +1385,8 @@ def find_item_assets(self, item, item_asset_directory=None, asset_directory=None if is_top_level and self.asset_folders and self.dimensional_asset_rename and (not poster or not background): for file in util.glob_filter(os.path.join(item_asset_directory, "*.*")): - if file.lower().endswith((".png", ".jpg", ".jpeg", "webp")) and not re.match(r"s\d+e\d+|season\d+", file.lower()): + p_file = Path(file).name + if p_file.lower().endswith((".png", ".jpg", ".jpeg", "webp")) and not re.match(r"s\d+e\d+|season\d+", p_file.lower()): try: with Image.open(file) as image: _w, _h = image.size