summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-19 23:35:44 +0300
committerPaul Buetow <paul@buetow.org>2025-07-19 23:35:44 +0300
commit6038d6e29d4878cccb46bf35bb9885ec7d376422 (patch)
treef7861a731ba20db54e4ca578d6cd586ad8a87ab0 /cmd
parent3a6c690230f769ad33bc26e2fc5d5662e38fe3d6 (diff)
feat: improve flashcard storage and audio regenerationv0.6.0
- Change default card storage from ~/Downloads to ~/.local/state/totalrecall/cards/ - Keep .apkg exports in ~/Downloads for user convenience - Fix audio regeneration to use random voice and speed (0.9-1.0) - Fix GNOME dock icon by updating StartupWMClass to "Totalrecall" - Fix navigation to properly find cards in new XDG state directory - Ensure config defaults are properly filled when using GUI mode - Bump version to 0.6.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/totalrecall/main.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go
index f50750f..ab06987 100644
--- a/cmd/totalrecall/main.go
+++ b/cmd/totalrecall/main.go
@@ -73,7 +73,7 @@ func init() {
// Initialize random number generator
rand.Seed(time.Now().UnixNano())
- // Set default output directory to Downloads
+ // Set default output directory based on mode
home, _ := os.UserHomeDir()
defaultOutputDir := filepath.Join(home, "Downloads")
@@ -931,12 +931,21 @@ Word: [IPA transcription]
func runGUIMode() error {
// Create GUI configuration from command line flags and viper config
guiConfig := &gui.Config{
- OutputDir: outputDir,
AudioFormat: audioFormat,
ImageProvider: imageAPI,
OpenAIKey: getOpenAIKey(),
}
+ // Only set OutputDir if it was explicitly provided via flag
+ // Check if the outputDir is different from the default
+ home, _ := os.UserHomeDir()
+ defaultOutputDir := filepath.Join(home, "Downloads")
+ if outputDir != defaultOutputDir {
+ // User explicitly set a different output directory
+ guiConfig.OutputDir = outputDir
+ }
+ // Otherwise, gui.New will use its own default (XDG state directory)
+
// Create and run GUI application
app := gui.New(guiConfig)
app.Run()