diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-02 22:26:43 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-02 22:26:43 +0300 |
| commit | 5a1a6b863c3adaa8ec9d087ba130f7676fc9575b (patch) | |
| tree | 31494a962d15f46bed22f8ba090afe7511dc54c7 /internal/processor/processor_test.go | |
| parent | 842ce63eda42a5dfa1599bf69b5ea22b332a954d (diff) | |
task zz: add Voices()/BuildAttribution() to Provider interface [OCP]
Extend audio.Provider with Voices() []string and BuildAttribution() string
so all provider-specific behaviour is encapsulated in the implementation
rather than scattered as switch-cases across callers.
Add package-level VoicesFor(name) and BuildAttributionFor(name, params)
for callers (processor, GUI) that need these before constructing a
Provider instance. Add AttributionParamsFrom(config, word, ...) so
callers can build AttributionParams from the flat Config without a manual
provider switch. Implement both new interface methods in OpenAIProvider
and GeminiProvider. Update all Provider mock/fake types in tests.
Migrate audioVoicesForProvider() and saveAudioAttribution() in both
processor.go and gui/generator.go to use the new package-level helpers,
replacing the 10+ duplicated switch blocks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/processor/processor_test.go')
| -rw-r--r-- | internal/processor/processor_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/processor/processor_test.go b/internal/processor/processor_test.go index cfa4545..34cc844 100644 --- a/internal/processor/processor_test.go +++ b/internal/processor/processor_test.go @@ -101,6 +101,14 @@ func (f *fakeAudioProvider) IsAvailable() error { return nil } +func (f *fakeAudioProvider) Voices() []string { + return nil +} + +func (f *fakeAudioProvider) BuildAttribution(params audio.AttributionParams) string { + return "" +} + func captureStdout(t *testing.T, fn func()) (output string) { t.Helper() |
