files search added (wip)

This commit is contained in:
partisan 2024-05-23 10:56:26 +02:00
parent 585684f15b
commit 31460ee6be
13 changed files with 431 additions and 44 deletions

16
text.go
View file

@ -173,22 +173,6 @@ func fetchAndCacheResults(query, safe, lang string, page, resultsPerPage int) []
return combinedResults
}
func paginateResults(results []TextSearchResult, page, resultsPerPage int) []TextSearchResult {
startIndex := (page - 1) * resultsPerPage
endIndex := startIndex + resultsPerPage
log.Printf("Paginating results: startIndex=%d, endIndex=%d, totalResults=%d", startIndex, endIndex, len(results))
if startIndex >= len(results) {
return []TextSearchResult{}
}
if endIndex > len(results) {
endIndex = len(results)
}
return results[startIndex:endIndex]
}
func sourceOrder(source string) int {
switch source {
case "Google":