doocus improvemnts
This commit is contained in:
@@ -40,7 +40,34 @@ docs-output/
|
||||
|
||||
Node **modes**: `extracted` (docx/pdf/pptx/xlsx → text sidecar) · `meeting`
|
||||
(mp4/mkv/... → belongs to meetus, not a doc) · `link` (everything else → original
|
||||
is the artifact, nothing duplicated).
|
||||
is the artifact, nothing duplicated). Every node also carries `created` (birth
|
||||
time, falling back to mtime) so docs and meetings sort by creation date coherently.
|
||||
|
||||
## Meetings
|
||||
|
||||
Videos are `meeting` nodes — doocus does **not** transcribe them; meetus does. To
|
||||
keep everything in one coherent, searchable tree, run meetus over **only** the
|
||||
meetings doocus found and write each into a `<file>.meetus/` sidecar right next to
|
||||
its `<file>.doocus/`-style neighbours:
|
||||
|
||||
```bash
|
||||
# 1. index the drive → docs-output/{index.json, meetings.txt}
|
||||
uv run make docs IN="/mnt/drive"
|
||||
|
||||
# 2. meetus over ONLY the listed meetings, re-rooted at the mount, into
|
||||
# <file>.meetus/ sidecars (matches the pointer doocus already wrote):
|
||||
make batch IN="/mnt/drive" OUT=docs-output \
|
||||
LIST=docs-output/meetings.txt \
|
||||
OUT_FORMAT="{name}.meetus"
|
||||
```
|
||||
|
||||
- `meetings.txt` holds **relative** paths only — mount the drive anywhere and the
|
||||
`-l/--list` re-roots them under `-i`, so this machine reads only the meetings.
|
||||
- `OUT_FORMAT="{name}.meetus"` is meetus's new `--out-format` (tokens `{date}
|
||||
{run} {stem} {name}`; default keeps `YYYYMMDD-NNN-<stem>`). Omitting `{run}`
|
||||
makes the folder deterministic, so it matches the `out`/`transcript` pointer the
|
||||
indexer set on each `meeting` node — no relink step.
|
||||
- Frames land in `<file>.meetus/frames/` for now (unchanged).
|
||||
|
||||
## Supported types
|
||||
|
||||
|
||||
@@ -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