This commit is contained in:
+21
-12
@@ -88,7 +88,7 @@ func (s *SearchService) SearchMediaWithDeadline(queries []string, enabledPlatfor
|
||||
results := make([]SearchResult, 0, 90)
|
||||
var lastErr error
|
||||
|
||||
baseQueries := limitQueries(queries, 6)
|
||||
baseQueries := limitQueries(queries, 8)
|
||||
shuffleStrings(baseQueries)
|
||||
primaryQueries := baseQueries[:minInt(len(baseQueries), 3)]
|
||||
runSearchPass := func(bases []string, onlyMissing bool) {
|
||||
@@ -190,7 +190,7 @@ func (s *SearchService) EnrichResults(results []SearchResult) []SearchResult {
|
||||
}
|
||||
|
||||
func (s *SearchService) EnrichResultsWithDeadline(results []SearchResult, deadline time.Time) []SearchResult {
|
||||
limit := minInt(len(results), 14)
|
||||
limit := minInt(len(results), 18)
|
||||
if limit == 0 {
|
||||
return results
|
||||
}
|
||||
@@ -722,13 +722,10 @@ func defaultMediaMode(source, link, previewURL, thumbnailURL string) (string, st
|
||||
embedURL := buildEmbedURL(source, link)
|
||||
switch source {
|
||||
case "Google Video":
|
||||
if embedURL != "" {
|
||||
return "embed", embedURL, ""
|
||||
}
|
||||
if hasUsableThumbnail(thumbnailURL) {
|
||||
return "thumbnail", "", "missing_google_embed"
|
||||
return "thumbnail", embedURL, "webpage_like_preview_preferred"
|
||||
}
|
||||
return "none", "", "missing_google_embed"
|
||||
return "none", embedURL, "webpage_like_preview_preferred"
|
||||
case "Envato":
|
||||
if strings.TrimSpace(previewURL) != "" {
|
||||
return "preview_video", embedURL, "provider_embed_blocked"
|
||||
@@ -741,12 +738,12 @@ func defaultMediaMode(source, link, previewURL, thumbnailURL string) (string, st
|
||||
}
|
||||
return "none", "", "provider_embed_blocked"
|
||||
case "Artgrid":
|
||||
if hasUsableThumbnail(thumbnailURL) {
|
||||
return "thumbnail", embedURL, "provider_preview_unavailable"
|
||||
}
|
||||
if strings.TrimSpace(previewURL) != "" {
|
||||
return "preview_video", embedURL, "provider_preview_unavailable"
|
||||
}
|
||||
if hasUsableThumbnail(thumbnailURL) {
|
||||
return "thumbnail", embedURL, "provider_preview_unavailable"
|
||||
}
|
||||
if embedURL != "" {
|
||||
return "embed", embedURL, ""
|
||||
}
|
||||
@@ -774,6 +771,18 @@ func DecorateRecommendationMedia(item AIRecommendation) AIRecommendation {
|
||||
if item.MediaMode == "thumbnail" && !hasUsableThumbnail(item.ThumbnailURL) && strings.TrimSpace(item.PreviewVideoURL) != "" {
|
||||
item.MediaMode = "preview_video"
|
||||
}
|
||||
switch item.Source {
|
||||
case "Google Video":
|
||||
item.ActionType = "download"
|
||||
item.ActionLabel = "Direct Download"
|
||||
item.SecondaryActionLabel = "Open Source"
|
||||
case "Envato", "Artgrid":
|
||||
item.ActionType = "open_source"
|
||||
item.ActionLabel = "Open Source"
|
||||
default:
|
||||
item.ActionType = "open_source"
|
||||
item.ActionLabel = "Open Source"
|
||||
}
|
||||
return item
|
||||
}
|
||||
|
||||
@@ -1380,9 +1389,9 @@ func limitCollectorQueries(collector string, queries []string, onlyMissing bool)
|
||||
limit := 2
|
||||
switch collector {
|
||||
case "Envato", "Artgrid":
|
||||
limit = 3
|
||||
limit = 4
|
||||
case "Google Video":
|
||||
limit = 2
|
||||
limit = 3
|
||||
}
|
||||
if onlyMissing {
|
||||
limit--
|
||||
|
||||
Reference in New Issue
Block a user