feat(attachments): scan enumerates all; import_file maps 'attached' + member ML
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,20 @@ from sqlalchemy.orm import sessionmaker
|
||||
from ..celery_app import celery
|
||||
from ..config import get_config
|
||||
from ..models import ImportBatch, ImportSettings, ImportTask
|
||||
from ..services.importer import is_supported
|
||||
|
||||
|
||||
def _iter_import_files(import_root: Path):
|
||||
"""Every regular file except sidecar .json, dotfiles, and .partial
|
||||
temp files. The Importer dispatches by kind (media / archive /
|
||||
other) — scan no longer filters to media (FC-2d-iii)."""
|
||||
for entry in import_root.rglob("*"):
|
||||
if not entry.is_file():
|
||||
continue
|
||||
if entry.name.startswith("."):
|
||||
continue
|
||||
if entry.suffix.lower() in (".json", ".partial"):
|
||||
continue
|
||||
yield entry
|
||||
|
||||
|
||||
def _sync_session_factory():
|
||||
@@ -42,11 +55,7 @@ def scan_directory(self, triggered_by: str = "manual") -> int:
|
||||
|
||||
# Walk and enumerate.
|
||||
files_seen = 0
|
||||
for entry in import_root.rglob("*"):
|
||||
if not entry.is_file():
|
||||
continue
|
||||
if not is_supported(entry):
|
||||
continue
|
||||
for entry in _iter_import_files(import_root):
|
||||
try:
|
||||
size = entry.stat().st_size
|
||||
except OSError:
|
||||
|
||||
Reference in New Issue
Block a user