From 5a1a6b863c3adaa8ec9d087ba130f7676fc9575b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 2 Apr 2026 22:26:43 +0300 Subject: 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 --- internal/processor/processor_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/processor/processor_test.go') 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() -- cgit v1.2.3