Commit Graph

8 Commits

Author SHA1 Message Date
david 120993fb02 test: add comprehensive test suite - 5 test files, 65% coverage
- cli_test.go: 10 tests for list/search/extract/download commands
- serve_test.go: 11 tests for HTTP handlers and SSE progress
- http_test.go: 5 subtests for archive.org API
- download_test.go: 10 tests for download logic
- util_test.go: 7 tests for string/util helpers

Error paths covered: server errors, empty results, download failures,
extract failures, missing identifiers, ReadDir errors.

golangci-lint: 0 issues, go vet: clean
2026-06-21 23:54:57 -07:00
david 31fd368bda fix: create parent dirs for downloads with subdirectory paths
Some archive.org file names include directory prefixes
(e.g. "ZERO-G - Deepest India/vocal.iso"). MkdirAll only
created the output root, not intermediate directories.
Added filepath.Dir(MkdirAll) in both downloadFile (CLI)
and handleAPIDownload (web).
2026-06-21 22:31:49 -07:00
david 15979d01b5 fix: check MkdirAll errors, add gopls to toolchain
- serve.go/cmdAPIDownload: check MkdirAll error, use absolute path
- main.go/cmdDownload,cmdExtract: check MkdirAll errors
- check-toolchain.sh: verify gopls installation
- mise.toml: add gopls install task
- AGENTS.md: document gopls as dev dependency
2026-06-21 22:27:17 -07:00
david ea2bcde74b feat: reimplement WAV extraction in Go (replaces extract_wavs.sh)
extract.go replaces the bash script with idiomatic Go:
- akaiutil process communication via stdin/stdout pipes
- partition enumeration (df output parsing)
- volume enumeration (dir output parsing per partition)
- sample2wavall per volume with WAV count aggregation

runAkaiutil is a package-level var — tests stub it with canned
output to verify parsing without a real akaiutil binary or ISO.

Removed: findScript(), -tool flag on extract, os/exec from main.go
Kept: extract_wavs.sh as a standalone utility (no longer called)
2026-06-21 22:17:24 -07:00
david bc12130dd6 fix: ensure output dirs exist in extract and API extract
cmdExtract and handleAPIExtract were missing os.MkdirAll calls
while cmdDownload, cmdPipeline, and handleAPIDownload all had
them. The bash script creates dirs internally but this is not
robust — create dirs in Go before shelling out.

Closes #13
2026-06-21 22:04:47 -07:00
david 4c09fb8d9b fix: useful Docker bind address output in serve
When binding to 0.0.0.0 (--host 0.0.0.0), print "localhost" and
"<host-ip>" URLs instead of the raw 0.0.0.0 address. Also handles
nil TCPAddr.IP to avoid the ":::" garbled display in Docker.
2026-06-21 22:03:01 -07:00
david 48d6d8c4d3 fix: macOS bcopy conflict and Docker host binding
- Fix #11: Guard bcopy/bzero declarations with _VISUALCPP in commoninclude.h
  to avoid redefinition errors on macOS where <strings.h> provides them
- Fix #12: Add --host flag to serve command, default 127.0.0.1
  Docker now binds to 0.0.0.0 so Colima can reach the server from host
- Also fix truncate() panic when n < 3
2026-06-21 21:40:41 -07:00
david e2dbb66525 feat: web UI + HTTP server + Electron shell
- serve.go: embedded web UI (embed.FS), REST API endpoints for
  search, list, download (SSE progress), and WAV extraction
- main.go: added serve subcommand and flag registration
- web/ui: vanilla JS frontend with search cards, download queue,
  extract controls; dark theme, zero dependencies
- electron/: Electron wrapper that spawns fetch serve as sidecar,
  reads port from stdout, creates BrowserWindow; electron-builder
  config for macOS .app bundle with akaiutil + script as resources

Refs #1, #9
2026-06-21 19:46:30 -07:00