refactor: remove hidden files indexing configuration and convert to UI-only display preference, eliminating includeHidden and hiddenWhitelist from vault config and indexing logic while adding hideHiddenFiles client-side filtering
This commit is contained in:
@@ -4,8 +4,6 @@ from pathlib import Path
|
||||
from typing import Dict, List, Optional, Set
|
||||
import threading
|
||||
|
||||
from backend.utils import should_include_path
|
||||
|
||||
logger = logging.getLogger("obsigate.attachment_indexer")
|
||||
|
||||
# Image file extensions to index
|
||||
@@ -40,12 +38,12 @@ def _scan_vault_attachments(vault_name: str, vault_path: str, vault_cfg: dict =
|
||||
"""Synchronously scan a vault directory for image attachments.
|
||||
|
||||
Walks the vault tree and builds a filename -> absolute path mapping
|
||||
for all image files.
|
||||
for all image files. All files are scanned, including hidden files (starting with '.').
|
||||
|
||||
Args:
|
||||
vault_name: Display name of the vault.
|
||||
vault_path: Absolute filesystem path to the vault root.
|
||||
vault_cfg: Optional vault configuration dict with hidden files settings.
|
||||
vault_cfg: Optional vault configuration dict (unused for indexing, kept for compatibility).
|
||||
|
||||
Returns:
|
||||
Dict mapping lowercase filenames to lists of absolute paths.
|
||||
@@ -53,10 +51,6 @@ def _scan_vault_attachments(vault_name: str, vault_path: str, vault_cfg: dict =
|
||||
vault_root = Path(vault_path)
|
||||
index: Dict[str, List[Path]] = {}
|
||||
|
||||
# Default config if not provided
|
||||
if vault_cfg is None:
|
||||
vault_cfg = {"includeHidden": False, "hiddenWhitelist": []}
|
||||
|
||||
if not vault_root.exists():
|
||||
logger.warning(f"Vault path does not exist for attachment scan: {vault_path}")
|
||||
return index
|
||||
@@ -65,11 +59,6 @@ def _scan_vault_attachments(vault_name: str, vault_path: str, vault_cfg: dict =
|
||||
|
||||
try:
|
||||
for fpath in vault_root.rglob("*"):
|
||||
# Check if path should be included based on hidden files configuration
|
||||
rel_parts = fpath.relative_to(vault_root).parts
|
||||
if not should_include_path(rel_parts, vault_cfg):
|
||||
continue
|
||||
|
||||
# Only process files
|
||||
if not fpath.is_file():
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user