Expand Artgrid query coverage to artlist canonical URLs
build-push / docker (push) Successful in 4m23s

This commit is contained in:
AI Assistant
2026-03-13 20:15:51 +09:00
parent d8cc32e2e7
commit 6d9391bc2b
3 changed files with 33 additions and 1 deletions
+13
View File
@@ -128,6 +128,19 @@
- Effect:
- avoids backend 500 during the Gemini Vision evaluation stage for mid-sized result sets
## Current Session Update (2026-03-13, Artgrid Query Coverage Fix)
- Another Artgrid no-results regression was found even after the collector URL matcher was widened.
- Root cause:
- Artgrid collector query generation still leaned on `site:artgrid.io/clip/`
- in practice, canonical clip pages can surface under `artlist.io/stock-footage/clip/...`
- so some Artgrid-only searches still returned zero renderable results even though the accept filter had been fixed
- Fix applied:
- Artgrid query generation now searches both:
- `site:artgrid.io/clip/`
- `site:artlist.io/stock-footage/clip/`
- Effect:
- improves Artgrid recall in SearXNG result sets that favor canonical Artlist URLs over Artgrid URLs
## Local Self-Test Workflow
- Primary command:
- `bash scripts/selftest.sh`
+2
View File
@@ -336,6 +336,8 @@ func buildArtgridQueries(base string) []string {
return []string{
fmt.Sprintf(`"%s" ("stock footage" OR "b-roll" OR cinematic OR editorial) site:artgrid.io/clip/`, base),
fmt.Sprintf(`"%s" ("footage" OR "cinematic" OR "establishing shot") site:artgrid.io/clip/`, base),
fmt.Sprintf(`"%s" ("stock footage" OR "b-roll" OR cinematic OR editorial) site:artlist.io/stock-footage/clip/`, base),
fmt.Sprintf(`"%s" ("footage" OR "cinematic" OR "establishing shot") site:artlist.io/stock-footage/clip/`, base),
}
}
+18 -1
View File
@@ -1,6 +1,9 @@
package services
import "testing"
import (
"strings"
"testing"
)
func TestExtractVideoPreviewURLFindsEnvatoPreview(t *testing.T) {
html := `<script type="application/ld+json">{"contentUrl":"https://video-previews.elements.envatousercontent.com/ad0a3abc-7eb0-4075-8f68-8198f9a08777/watermarked_preview/watermarked_preview.mp4"}</script>`
@@ -64,6 +67,20 @@ func TestIsRenderableArtgridResultAcceptsArtlistCanonical(t *testing.T) {
}
}
func TestBuildArtgridQueriesIncludesArtlistCanonicalDomain(t *testing.T) {
queries := buildArtgridQueries("friendly couple")
found := false
for _, query := range queries {
if strings.Contains(query, "site:artlist.io/stock-footage/clip/") {
found = true
break
}
}
if !found {
t.Fatal("expected Artgrid queries to include artlist canonical domain")
}
}
func TestGeminiCandidateLimitNeverExceedsCandidates(t *testing.T) {
if got := GeminiCandidateLimit(9); got != 9 {
t.Fatalf("expected Gemini limit to stay within candidate count, got %d", got)