From e0e85a36b669de6e1386b029b49e70e4c82552b3 Mon Sep 17 00:00:00 2001 From: ryan schemm Date: Sun, 18 Jun 2023 15:19:29 -0700 Subject: [PATCH] Don't error if os.path.basename(dir) is empty --- src/picframe/image_cache.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/picframe/image_cache.py b/src/picframe/image_cache.py index cc2afb2..f4ccc8a 100644 --- a/src/picframe/image_cache.py +++ b/src/picframe/image_cache.py @@ -356,8 +356,9 @@ def __get_modified_folders(self): out_of_date_folders = [] sql_select = "SELECT * FROM folder WHERE name = ?" for dir in [d[0] for d in os.walk(self.__picture_dir, followlinks=self.__follow_links)]: - if os.path.basename(dir)[0] == '.': - continue # ignore hidden folders + if os.path.basename(dir): + if os.path.basename(dir)[0] == '.': + continue # ignore hidden folders mod_tm = int(os.stat(dir).st_mtime) found = self.__db.execute(sql_select, (dir,)).fetchone() if not found or found['last_modified'] < mod_tm or found['missing'] == 1: