summaryrefslogtreecommitdiff
path: root/internal/probe
AgeCommit message (Collapse)Author
2026-05-17Restructure repo: move Go server into player-server/Paul Buetow
2026-05-10Add compile-time interface assertions for FFProber, FFmpegGenerator, FFRemuxerPaul Buetow
2026-05-09style: gofmt and goimports formatting fixesPaul Buetow
2026-05-09Harden external process and network callsPaul Buetow
- Add cmd.WaitDelay (10-15s) to ffprobe, ffmpeg remux, and thumbnail generation. - Add bounded retries with exponential backoff to FFProber.Probe (max 3 attempts). - Inject *http.Client into podcast ParseFeed, replacing gofeed's default client. - Update all callers (podcast service, tests, integration tests) to pass client. - Ensure go test ./... -race -cover passes.
2026-05-07Fix remux error propagation for task o0Paul Buetow
2026-05-07task 31: introduce media streamer servicePaul Buetow
2026-05-04task 9: Centralize file extension and media type mappings in internal/mediatypePaul Buetow
Create a new internal/mediatype package with a single source of truth for: - Extension-to-media-type mappings (TypeForExt) - Extension-to-MIME mappings (MIMETypeForExt) - Supported extension checks (IsSupportedExt, IsImageExt, IsCoverImageExt) Replace duplicated logic across: - internal/service/service.go (supportedExtensions, guessMediaType) - internal/scanner/scanner.go (mediaExtensions, imageExtensions, mediaTypeFromExt) - internal/api/handlers.go (probe.MimeTypeForFilename) - internal/probe/probe.go (imageExtensions, isImagePath) - internal/probe/remux.go (MimeTypeForFilename) Divergent defaults unified: both scanner and service now default unknown extensions to video (model.MediaTypeVideo) via mediatype.TypeForExt. Update tests to use mediatype package and remove obsolete scanner tests. Update AGENTS.md to reflect the new package.
2026-05-03refactor(api): extract Remuxer interface and move ffmpeg/MPEG-TS/mime logic ↵Paul Buetow
to internal/probe Move LooksLikeMPEGTS, MimeTypeForFilename and the ffmpeg remux path out of the api transport layer into a new internal/probe/remux.go package. This removes os/exec and mime tables from the api layer, satisfying the DIP principle. - New probe.Remuxer interface with FFRemuxer implementation - Server depends on probe.Remuxer, injected via NewServer - Updated cmd/mediaplayer wiring and all test helpers - All tests pass: go test ./... -race -cover
2026-05-03test: raise coverage above 60% in cmd/mediaplayer, model, and probePaul Buetow
- cmd/mediaplayer: add runWithSignal injection point for testing; cover version flag, invalid flags, invalid config, normal shutdown, all log levels, invalid DB, and privileged-port bind failure. Refactor run() to delegate to runWithSignal with optional signal channel. - internal/config: allow PORT=0 (ephemeral) to support test server startup. Update AGENTS.md validation docs accordingly. - internal/model: add comprehensive ScanProgress tests (Start, Done, IncrementFile/Set, SetCurrentSet/FilesTotal, Copy isolation, and concurrent access). - internal/probe: add image tests for isImagePath (all extensions and case insensitivity), real EXIF extraction via ImageMagick + exiv2, Probe against real JPEG, MP4, empty file, and nonexistent paths. - internal/config_test: replace PORT=0 invalid-value test with PORT=-1.
2026-05-03fix(admin): fix rescan goroutine lifecycle and race on shared ScanProgressPaul Buetow
- Protect adminService scan state (cancel func + progress pointer) with sync.Mutex. - Allocate fresh ScanProgress per trigger and pass it to the scanner, eliminating races on the previously shared progress struct. - Cancel previous scan context before starting a new one. - Add tests for cancellation, fresh progress per scan, concurrent triggers, and empty progress when never started. - Fix race-prone tests by polling Running==true before waiting for completion.
2026-05-01Rename Go module from codeberg.org/snonux/play to codeberg.org/snonux/playerPaul Buetow
2026-04-30Rename module to codeberg.org/snonux/play (task aa)Paul Buetow
- Update go.mod module path - Replace all internal imports from github.com/paul/kiss-media-player to codeberg.org/snonux/play - Run go mod tidy and gofmt -w .
2026-04-29feat: implement filesystem scannerPaul Buetow
2026-04-28h9: scaffold go project structurePaul Buetow
- Initialize go.mod (github.com/paul/kiss-media-player) - Add internal/version.go with const Version - Add internal/config.go with env-based Config struct and validation (PORT, MEDIA_ROOT, DB_PATH, MAX_UPLOAD_SIZE_MB, SESSION_TIMEOUT_HOURS, GC_INTERVAL_MINUTES, SHARE_DEFAULT_EXPIRY_DAYS, LOG_LEVEL) - Add table-driven config validation tests (defaults, overrides, invalid values) - Add cmd/mediaplayer/main.go with -version flag - Create directory scaffold: internal/{model,repository,scanner,probe,thumb, clock,auth,service,api,setassign}, web/{css,js}, k8s - Add .gitignore for binaries and data.db - Refactor env parsing into envInt/envString helpers per go-best-practices