updated logging, added theming, added settings button

This commit is contained in:
partisan 2024-08-11 21:45:52 +02:00
parent 51b2ef43bc
commit ca15fb7ec5
25 changed files with 384 additions and 62 deletions

View file

@ -39,7 +39,7 @@ func initializeTorrentSites() {
// rutor = NewRutor()
}
func handleFileSearch(w http.ResponseWriter, query, safe, lang string, page int) {
func handleFileSearch(w http.ResponseWriter, settings UserSettings, query, safe, lang string, page int) {
startTime := time.Now()
cacheKey := CacheKey{Query: query, Page: page, Safe: safe == "true", Lang: lang, Type: "file"}
@ -69,6 +69,7 @@ func handleFileSearch(w http.ResponseWriter, query, safe, lang string, page int)
HasNextPage bool
Page int
Settings Settings
Theme string
}{
Results: combinedResults,
Query: query,
@ -78,7 +79,8 @@ func handleFileSearch(w http.ResponseWriter, query, safe, lang string, page int)
HasPrevPage: page > 1,
HasNextPage: len(combinedResults) > 0,
Page: page,
Settings: Settings{UxLang: lang, Safe: safe},
Settings: Settings{UxLang: lang, Safe: safe}, // Now this is painful, are there two Settings variables??
Theme: settings.Theme,
}
// // Debugging: Print results before rendering template