Skip to content

Commit

Permalink
Don't error if os.path.basename(dir) is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rschemm authored and helgeerbe committed Feb 19, 2024
1 parent db30d32 commit e0e85a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/picframe/image_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e0e85a3

Please sign in to comment.