This commit is contained in:
2026-03-04 19:33:47 +03:00
parent 42def69dcc
commit 2820e491d5
28 changed files with 972 additions and 365 deletions

View File

@@ -228,6 +228,25 @@ class StoragePlugin(PluginBase):
f"[StoragePlugin][Action] Listing files in root: {root}, category: {category}, subpath: {subpath}, recursive: {recursive}"
)
files = []
# Root view contract: show category directories only.
if category is None and not subpath:
for cat in FileCategory:
base_dir = root / cat.value
if not base_dir.exists():
continue
stat = base_dir.stat()
files.append(
StoredFile(
name=cat.value,
path=cat.value,
size=0,
created_at=datetime.fromtimestamp(stat.st_ctime),
category=cat,
mime_type="directory",
)
)
return sorted(files, key=lambda x: x.name)
categories = [category] if category else list(FileCategory)