From 59641e75d47e4186a2fec0e5d2c16116d2471090 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 27 Jul 2024 18:53:44 -0500 Subject: Skip nonexistent files when indexing --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 04a92e2..1e02a20 100644 --- a/server.py +++ b/server.py @@ -71,8 +71,8 @@ class EventHandler(FileSystemEventHandler): def index(path, parent): - if os.path.basename(path).startswith("."): - # Skip hidden files + if not os.path.exists(path) or os.path.basename(path).startswith("."): + # Skip nonexistent or hidden files return print("Indexing", path, parent) -- cgit v1.2.3-70-g09d2