Stabilize modal rendering and sequential Gemini flow
build-push / docker (push) Successful in 4m13s

This commit is contained in:
AI Assistant
2026-03-16 12:45:12 +09:00
parent 82cead950e
commit c0830b5fde
7 changed files with 145 additions and 125 deletions
+3 -15
View File
@@ -12,7 +12,6 @@ import (
"regexp"
"sort"
"strings"
"sync"
"time"
)
@@ -127,26 +126,15 @@ func (s *SearchService) SearchMedia(queries []string, enabledPlatforms map[strin
}
func (s *SearchService) EnrichResults(results []SearchResult) []SearchResult {
limit := minInt(len(results), 18)
if limit == 0 {
if len(results) == 0 {
return results
}
enriched := make([]SearchResult, len(results))
copy(enriched, results)
var wg sync.WaitGroup
sem := make(chan struct{}, 4)
for idx := 0; idx < limit; idx++ {
wg.Add(1)
go func(i int) {
defer wg.Done()
sem <- struct{}{}
defer func() { <-sem }()
enriched[i] = s.enrichResult(enriched[i])
}(idx)
for idx := range enriched {
enriched[idx] = s.enrichResult(enriched[idx])
}
wg.Wait()
return enriched
}