diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-10 23:11:30 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-10 23:11:30 +0300 |
| commit | 65430e9876a32988839deb7a70dc1e42da21cf64 (patch) | |
| tree | e0de040cb53d5b90587908f2d55e86e49664fc35 /internal/processor/image_downloader.go | |
| parent | 4b4b3665230faafbd994f09894cb07c8f9d4b359 (diff) | |
Release 0.28.2v0.28.2
Diffstat (limited to 'internal/processor/image_downloader.go')
| -rw-r--r-- | internal/processor/image_downloader.go | 10 |
1 files changed, 10 insertions, 0 deletions
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). |
