From b2b007699b2a42ed86970f59d597034679265e91 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 16 Jul 2025 23:24:39 +0300 Subject: Remove Pixabay and Unsplash image search support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete Pixabay and Unsplash implementation files - Remove API key configuration for both services - Update CLI and GUI to only support OpenAI DALL-E - Update documentation to reflect OpenAI as sole image provider - Fix tests to handle nil client in OpenAI implementation - Simplify configuration examples The application now exclusively uses OpenAI DALL-E for image generation, providing AI-generated educational images with creative art styles. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- cmd/totalrecall/main.go | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'cmd') diff --git a/cmd/totalrecall/main.go b/cmd/totalrecall/main.go index e6b74a0..83695e8 100644 --- a/cmd/totalrecall/main.go +++ b/cmd/totalrecall/main.go @@ -77,7 +77,7 @@ func init() { // Local flags rootCmd.Flags().StringVarP(&outputDir, "output", "o", "./anki_cards", "Output directory") rootCmd.Flags().StringVarP(&audioFormat, "format", "f", "mp3", "Audio format (wav or mp3)") - rootCmd.Flags().StringVar(&imageAPI, "image-api", "openai", "Image source (pixabay, unsplash, or openai)") + rootCmd.Flags().StringVar(&imageAPI, "image-api", "openai", "Image source (only openai supported)") rootCmd.Flags().StringVar(&batchFile, "batch", "", "Process words from file (one per line)") rootCmd.Flags().BoolVar(&skipAudio, "skip-audio", false, "Skip audio generation") rootCmd.Flags().BoolVar(&skipImages, "skip-images", false, "Skip image download") @@ -360,20 +360,6 @@ func downloadImages(word string) error { var err error switch imageAPI { - case "pixabay": - apiKey := viper.GetString("image.pixabay_key") - searcher = image.NewPixabayClient(apiKey) - - case "unsplash": - apiKey := viper.GetString("image.unsplash_key") - if apiKey == "" { - return fmt.Errorf("Unsplash API key is required in config") - } - searcher, err = image.NewUnsplashClient(apiKey) - if err != nil { - return err - } - case "openai": // Create OpenAI image configuration openaiConfig := &image.OpenAIConfig{ @@ -410,9 +396,7 @@ func downloadImages(word string) error { searcher = image.NewOpenAIClient(openaiConfig) if openaiConfig.APIKey == "" { - fmt.Printf("Warning: OpenAI API key not found, falling back to Pixabay for images\n") - imageAPI = "pixabay" - searcher = image.NewPixabayClient("") + return fmt.Errorf("OpenAI API key is required for image generation") } default: @@ -716,8 +700,6 @@ func runGUIMode() error { ImageProvider: imageAPI, EnableCache: viper.GetBool("cache.enable"), OpenAIKey: getOpenAIKey(), - PixabayKey: viper.GetString("image.pixabay_key"), - UnsplashKey: viper.GetString("image.unsplash_key"), } // Create and run GUI application -- cgit v1.2.3