From fe388e903d05e9d8aeee4db6d6b9b2ac99f2cf55 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 30 Jan 2022 17:26:08 -0800 Subject: [PATCH] Fix export download not including images --- plexpy/exporter.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plexpy/exporter.py b/plexpy/exporter.py index 1feb8a04..196b15f0 100644 --- a/plexpy/exporter.py +++ b/plexpy/exporter.py @@ -1928,14 +1928,13 @@ class Export(object): self.file_size += os.path.getsize(filepath) def _exported_images(self, title): - images_dirpath = get_export_dirpath(self.directory, images_directory=title) + dirpath = get_export_dirpath(self.directory) - if os.path.exists(images_dirpath): - for f in os.listdir(images_dirpath): - if f.endswith('.thumb.jpg'): - self.exported_thumb = True - elif f.endswith('.art.jpg'): - self.exported_art = True + for root, dirs, files in os.walk(dirpath): + if any(f.endswith('.thumb.jpg') for f in files): + self.exported_thumb = True + elif any(f.endswith('.art.jpg') for f in files): + self.exported_art = True def _media_type(self, obj): return 'photoalbum' if self.is_photoalbum(obj) else obj.type