feat: multi-track transcription support
SKILL.md: - Step 2: user can provide multiple track indexes (e.g. mic + Discord) - Step 4: transcribe each track separately, cross-reference all transcripts - Step 5: get-transcription supports --track filter manage_index.py: - get-transcription: optional --track flag to filter by track index - Without --track, returns all transcription records (was: latest only)
This commit is contained in:
@@ -97,7 +97,13 @@ def cmd_add_transcription(args: argparse.Namespace) -> None:
|
||||
def cmd_get_transcription(args: argparse.Namespace) -> None:
|
||||
video = Path(args.video).expanduser().resolve()
|
||||
conn = connect(video)
|
||||
rows = conn.execute("SELECT * FROM transcription ORDER BY created_at DESC").fetchall()
|
||||
if args.track is not None:
|
||||
rows = conn.execute(
|
||||
"SELECT * FROM transcription WHERE track_index = ? ORDER BY created_at DESC",
|
||||
(args.track,),
|
||||
).fetchall()
|
||||
else:
|
||||
rows = conn.execute("SELECT * FROM transcription ORDER BY created_at DESC").fetchall()
|
||||
conn.close()
|
||||
if not rows:
|
||||
print(json.dumps({"found": False}))
|
||||
@@ -258,8 +264,9 @@ def main() -> None:
|
||||
p_at.add_argument("--duration", type=float, default=None)
|
||||
|
||||
# get-transcription
|
||||
p_gt = sub.add_parser("get-transcription", help="Get latest transcription record")
|
||||
p_gt = sub.add_parser("get-transcription", help="Get transcription records (all or by track)")
|
||||
p_gt.add_argument("--video", required=True)
|
||||
p_gt.add_argument("--track", type=int, default=None, help="Filter by track index (omit to get all)")
|
||||
|
||||
# add-clip
|
||||
p_ac = sub.add_parser("add-clip", help="Add a clip record")
|
||||
|
||||
Reference in New Issue
Block a user