459ab30d9481a347d9debc4cc3c438ff4331cec1
Thread context.Context from main through watcher, encoder, and metadata clients so a Ctrl-C during a multi-hour encode immediately kills the ffmpeg/ffprobe/opusenc children instead of waiting for them to finish. - main: signal.NotifyContext replaces the manual sigChan + done goroutine - watcher.Start: takes ctx, exits on ctx.Done(); processFn signature is now func(context.Context, string) error - encoder: Transcode and every helper (extractAudio, encodeOpus, encodeVideo, GetMediaInfo, GetStreamLanguages, calculateZscaleWidth) take ctx; every exec.Command becomes exec.CommandContext so the child is SIGKILL'd on cancel - metadata: FetchMovieMetadata, FetchSeriesMetadata, fetchTVMazeJSON take ctx and use http.NewRequestWithContext Mover stays ctx-free intentionally: a rename is fast enough that mid-cancel cleanup is the next-restart's problem. processFile's deferred RemoveAll(workDir) and failToFailed still run after cancel, so partial output dies in the work dir and the source moves to failed/.
Description
No description provided
150 KiB
Languages
Go
100%