From 4d27090f4478cb2260767ff81aa13c770c963f26 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Sat, 11 Dec 2021 15:39:57 -0500 Subject: [PATCH] allow recursive file searches --- modules/library.py | 2 +- modules/plex.py | 2 +- modules/util.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/library.py b/modules/library.py index 0a11999b..847ea58b 100644 --- a/modules/library.py +++ b/modules/library.py @@ -260,7 +260,7 @@ class Library(ABC): if os.path.isdir(os.path.join(ad, name)): item_dir = os.path.join(ad, name) else: - matches = util.glob_filter(os.path.join(ad, "*", name)) + matches = util.glob_filter(os.path.join(ad, "**", name)) if len(matches) > 0: item_dir = os.path.abspath(matches[0]) if item_dir is None: diff --git a/modules/plex.py b/modules/plex.py index 139fa7d4..af224219 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -631,7 +631,7 @@ class Plex(Library): if os.path.isdir(os.path.join(ad, name)): item_dir = os.path.join(ad, name) else: - matches = util.glob_filter(os.path.join(ad, "*", name)) + matches = util.glob_filter(os.path.join(ad, "**", name)) if len(matches) > 0: item_dir = os.path.abspath(matches[0]) if item_dir is None: diff --git a/modules/util.py b/modules/util.py index 39ea0622..bed96fbe 100644 --- a/modules/util.py +++ b/modules/util.py @@ -279,7 +279,7 @@ def time_window(time_window): def glob_filter(filter_in): filter_in = filter_in.translate({ord("["): "[[]", ord("]"): "[]]"}) if "[" in filter_in else filter_in - return glob.glob(filter_in) + return glob.glob(filter_in, recursive=True) def is_date_filter(value, modifier, data, final, current_time): if value is None: