| Age | Commit message (Collapse) | Author |
|
provider normalization
- task 009: remove translateBulgarianToEnglish from OpenAIClient and
NanoBananaClient. Image clients no longer make internal translation API calls;
callers must supply SearchOptions.Translation (processor and GUI already do).
When translation is absent, opts.Query (the Bulgarian word) is used as
fallback subject so image generation still proceeds. Update tests to pass
translation via SearchOptions rather than relying on the removed fallback.
- task 00i: consolidate duplicate ProviderGemini/ProviderOpenAI constants and
normalizeProvider() functions from internal/translation and internal/phonetic
into a shared config.NormalizeProvider(string) string in
internal/config/provider.go. Both packages now delegate to the shared
function so the normalization rule (lowercase, trim, default "gemini") has
one authoritative home.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Enable -race flag on the default 'task test' command so race conditions
are caught by default, not only when running 'task test-race'
- Add t.Parallel() to all tests in internal/image/prompt_test.go (pure
function tests with no shared state)
- Add t.Parallel() to TestReadBatchFile and its subtests in batch package
(file I/O with t.TempDir(), no global state)
- Add t.Parallel() to TestValidateBulgarianText and its subtests in audio
package (pure string validation, no shared state)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
batch timeout
- Thread ctx context.Context through generateAudio, generateAudioBgBg,
generateAudioWithVoice, generateAudioWithVoiceAndFilename,
generateAudioWithVoiceAndFilenameInDir, and downloadImagesWithTranslation.
Also add ctx to ProcessWordWithTranslationAndType so callers can control
the deadline for the full word-processing pipeline.
- In ProcessBatch, create a context.WithTimeout(5 * time.Minute) per word
so a single hung TTS or image API call cannot block the whole batch run.
Previously both functions created context.Background() internally, making
cancellation impossible.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
shared prompt
- task 00g: fix gofmt violations (trailing whitespace, missing newlines,
indentation) in 8 files; all pass gofmt -l now
- task 00k: remove unused ProviderWithFallback and its tests (YAGNI — no
production caller existed; voice-level fallback via RunWithVoiceFallbacks
already covers the real use case)
- task 00h: replace private splitLines/trimSpace/isSpace helpers in
internal/batch/processor.go with strings.Split+ReplaceAll and
strings.TrimSpace from the stdlib; remove the now-redundant tests
- task 008: extract buildEducationalPrompt into internal/image/prompt.go so
the prompt-assembly policy (scene truncation cascade, char limit) lives in
one place; both OpenAIClient and NanoBananaClient delegate to it
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- Remove dead DownloadImage stub from image/search.go (always returned nil,
real implementation lives in Downloader.DownloadImage in download.go)
- Add compile-time interface assertions for OpenAIProvider, ProviderWithFallback,
and OpenAIClient to catch interface drift at compile time
- Replace http.DefaultClient (no timeout) with a shared imageHTTPClient
(60s timeout) in both OpenAIClient and NanoBananaClient Download methods;
prevents goroutine hangs on slow/unresponsive image servers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Replace per-rune += string(r) heap allocations with strings.Builder in
SanitizeFilename (internal/utils.go) and splitLines (internal/batch/processor.go).
Both now call Grow/Reset appropriately to pre-allocate capacity.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|