From f3e301168ad742a556b336761e28f739eb1d7143 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 21 Jul 2025 15:06:01 +0300 Subject: feat: improve consistency between CLI and GUI modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix batch mode to store cards in ~/.local/state/totalrecall/cards/ matching GUI behavior - Add --no-auto-play flag to disable automatic audio playback (enabled by default) - Simplify phonetic fetching in CLI to match GUI (IPA only, no detailed explanations) - Remove redundant --gui flag as GUI is already the default mode - Align image generation settings: both modes now use DALL-E 2 with 512x512 resolution 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- internal/processor/processor.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'internal/processor/processor.go') diff --git a/internal/processor/processor.go b/internal/processor/processor.go index be4a5e6..f912da3 100644 --- a/internal/processor/processor.go +++ b/internal/processor/processor.go @@ -55,7 +55,7 @@ func (p *Processor) ProcessBatch() error { } } - // Create output directory + // Create output directory (including parent directories) if err := os.MkdirAll(p.flags.OutputDir, 0755); err != nil { return fmt.Errorf("failed to create output directory: %w", err) } @@ -80,7 +80,7 @@ func (p *Processor) ProcessSingleWord(word string) error { return fmt.Errorf("invalid word '%s': %w", word, err) } - // Create output directory + // Create output directory (including parent directories) if err := os.MkdirAll(p.flags.OutputDir, 0755); err != nil { return fmt.Errorf("failed to create output directory: %w", err) } @@ -280,10 +280,10 @@ func (p *Processor) downloadImagesWithTranslation(word, translationText string) } // Use config file values if not overridden by flags - if p.flags.OpenAIImageModel == "dall-e-3" && viper.IsSet("image.openai_model") { + if p.flags.OpenAIImageModel == "dall-e-2" && viper.IsSet("image.openai_model") { openaiConfig.Model = viper.GetString("image.openai_model") } - if p.flags.OpenAIImageSize == "1024x1024" && viper.IsSet("image.openai_size") { + if p.flags.OpenAIImageSize == "512x512" && viper.IsSet("image.openai_size") { openaiConfig.Size = viper.GetString("image.openai_size") } if p.flags.OpenAIImageQuality == "standard" && viper.IsSet("image.openai_quality") { @@ -397,6 +397,7 @@ func (p *Processor) RunGUIMode() error { AudioFormat: p.flags.AudioFormat, ImageProvider: p.flags.ImageAPI, OpenAIKey: cli.GetOpenAIKey(), + AutoPlay: !p.flags.NoAutoPlay, // Invert the flag (--no-auto-play disables auto-play) } // Only set OutputDir if it was explicitly provided via flag -- cgit v1.2.3