From 5d2290cabfb2972ebb164da2c270fc900ec62d60 Mon Sep 17 00:00:00 2001 From: th3r00t Date: Sat, 9 Aug 2025 17:04:27 +0000 Subject: [PATCH] Debuging collection folder pathing --- src/backend/lib/storage.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/lib/storage.py b/src/backend/lib/storage.py index 24716b4..e4a894e 100644 --- a/src/backend/lib/storage.py +++ b/src/backend/lib/storage.py @@ -171,8 +171,11 @@ class Storage: relative_parts = Path(file_name).relative_to(self.config.book_path).parts except ValueError: continue # skip books outside the configured path - - folder = relative_parts[1] + breakpoint() + if len(relative_parts) < 2: + folder = relative_parts[1] + else: + folder = relative_parts[0] # check if collection exists collection = session.execute( select(Collection).where(Collection.name == folder)