doocus improvemnts
This commit is contained in:
@@ -31,6 +31,11 @@ EXTRACT_EXTS = {"docx", "pdf", "pptx", "xlsx"}
|
||||
# Videos are meetings → meetus territory.
|
||||
MEETING_EXTS = {"mp4", "mkv", "mov", "m4v", "webm", "avi", "wmv"}
|
||||
|
||||
# Sidecar suffix meetus writes a meeting's output into. Must match the batch
|
||||
# invocation `make batch ... OUT_FORMAT="{name}.meetus"` so the index pointer set
|
||||
# here (deterministically, at index time) resolves once meetus has run.
|
||||
MEETING_SIDECAR_SUFFIX = ".meetus"
|
||||
|
||||
|
||||
def classify(ext: str) -> str:
|
||||
if ext in EXTRACT_EXTS:
|
||||
@@ -60,6 +65,7 @@ def build_index(source_root, output_dir, options=None, dry_run=False) -> dict:
|
||||
mode = classify(ext)
|
||||
counts[mode] += 1
|
||||
stat = p.stat()
|
||||
birth = getattr(stat, "st_birthtime", None) # not on every filesystem
|
||||
node = {
|
||||
"path": rel,
|
||||
"name": p.name,
|
||||
@@ -68,11 +74,17 @@ def build_index(source_root, output_dir, options=None, dry_run=False) -> dict:
|
||||
"mode": mode,
|
||||
"bytes": stat.st_size,
|
||||
"modified": datetime.fromtimestamp(stat.st_mtime).isoformat(),
|
||||
"created": datetime.fromtimestamp(birth or stat.st_mtime).isoformat(),
|
||||
"url": None, # Drive link — filled later from a URL source
|
||||
}
|
||||
|
||||
if mode == "extracted" and not dry_run:
|
||||
_extract_sidecar(p, rel, out, options, node, counts)
|
||||
elif mode == "meeting":
|
||||
# Deterministic pointer to meetus's output sidecar (produced later by
|
||||
# `make batch ... OUT_FORMAT="{name}.meetus"`). No relink needed.
|
||||
node["out"] = rel + MEETING_SIDECAR_SUFFIX
|
||||
node["transcript"] = f"{rel}{MEETING_SIDECAR_SUFFIX}/{p.stem}_enhanced.txt"
|
||||
|
||||
files.append(node)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user