From 65430e9876a32988839deb7a70dc1e42da21cf64 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 10 Apr 2026 23:11:30 +0300 Subject: Release 0.28.2 --- internal/processor/image_downloader.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/processor/image_downloader.go') diff --git a/internal/processor/image_downloader.go b/internal/processor/image_downloader.go index 1d6c002..fa0f6cf 100644 --- a/internal/processor/image_downloader.go +++ b/internal/processor/image_downloader.go @@ -24,6 +24,13 @@ import ( // AI image providers can generate more contextually accurate images. // ctx is passed to the image downloader so the caller's deadline applies. func (p *Processor) downloadImagesWithTranslation(ctx context.Context, word, translationText string) error { + return p.downloadImagesWithPrompt(ctx, word, translationText, "") +} + +// downloadImagesWithPrompt downloads images for a word and optionally reuses a +// previously-saved prompt. When customPrompt is empty the provider generates a +// fresh prompt as usual. +func (p *Processor) downloadImagesWithPrompt(ctx context.Context, word, translationText, customPrompt string) error { searcher, err := p.newImageSearcher() if err != nil { return err @@ -43,6 +50,9 @@ func (p *Processor) downloadImagesWithTranslation(ctx context.Context, word, tra if translationText != "" { searchOpts.Translation = translationText } + if strings.TrimSpace(customPrompt) != "" { + searchOpts.CustomPrompt = strings.TrimSpace(customPrompt) + } // Register a prompt callback so the AI-generated prompt is persisted // to disk before the download completes (used by the GUI and for debugging). -- cgit v1.2.3