summaryrefslogtreecommitdiff
path: root/internal/processor/processor.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-21 15:06:01 +0300
committerPaul Buetow <paul@buetow.org>2025-07-21 15:06:01 +0300
commitf3e301168ad742a556b336761e28f739eb1d7143 (patch)
tree36992608c8ddaab8b5d44221d4eab6f98eb5c8b9 /internal/processor/processor.go
parentb562f3b57f8e4f106aad8856e55b51f1d9d9a367 (diff)
feat: improve consistency between CLI and GUI modes
- 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 <noreply@opencode.ai>
Diffstat (limited to 'internal/processor/processor.go')
-rw-r--r--internal/processor/processor.go9
1 files changed, 5 insertions, 4 deletions
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