clean ui
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user