hide "map" on no-js website type, fix2

This commit is contained in:
partisan 2024-04-17 15:02:52 +02:00
parent 424dd0adab
commit 5b77d2a03c
4 changed files with 14 additions and 11 deletions

View file

@ -66,6 +66,8 @@ func fetchImageResults(query string, safe, lang string, page int) ([]ImageSearch
lang = "en_CA"
}
// Format &lang=lang_de is incorret, implement fix !
apiURL := fmt.Sprintf("https://api.qwant.com/v3/search/images?t=images&q=%s&count=%d&locale=%s&offset=%d&device=desktop&tgp=2&safesearch=%s",
url.QueryEscape(query),
resultsPerPage,
@ -100,11 +102,11 @@ func fetchImageResults(query string, safe, lang string, page int) ([]ImageSearch
var results []ImageSearchResult
for _, item := range apiResp.Data.Result.Items {
results = append(results, ImageSearchResult{
Thumbnail: item.Thumbnail, // Thumbnail URL
Title: item.Title, // Image title
Media: item.Media, // Direct link to the image - Ensure this field is used appropriately in your template
Source: item.Media, // Using item.Media here ensures the direct image link is used
ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media), // Proxy URL for the thumbnail, if needed
Thumbnail: item.Thumbnail, // Thumbnail URL
Title: item.Title, // Image title
Media: item.Media, // Direct link to the image
Source: item.Url,
ThumbProxy: "/img_proxy?url=" + url.QueryEscape(item.Media),
Width: item.Width,
Height: item.Height,
})