From bf568a865269c70dd0883db76310f651d819b478 Mon Sep 17 00:00:00 2001 From: Arnas Udovic Date: Thu, 29 Jun 2023 15:52:55 +0300 Subject: [PATCH] sgs and other for all pages --- main.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 4ca60a6..5c2552e 100644 --- a/main.go +++ b/main.go @@ -223,8 +223,12 @@ func renderIndex(lang string, w gemini.ResponseWriter, client TreeManagerClient) } func renderFeed(lang string, w gemini.ResponseWriter, r *gemini.Request, client TreeManagerClient) { - langFilter := TreeRequest_Filter{Key: "lang", Value: lang} - filters := []*TreeRequest_Filter{&langFilter} + filters := []*TreeRequest_Filter{{Key: "lang", Value: lang}} + if lang == "sgs" { + for _, l := range []string{"lt", "prg", "eo"} { + filters = append(filters, &TreeRequest_Filter{Key: "lang", Value: l}) + } + } path := "" tr := TreeRequest{Path: &path, Filter: filters} @@ -408,8 +412,12 @@ func renderFile(lang string, w gemini.ResponseWriter, r *gemini.Request, client } func renderAllFiles(lang string, w gemini.ResponseWriter, client TreeManagerClient) { - langFilter := TreeRequest_Filter{Key: "lang", Value: lang} - filters := []*TreeRequest_Filter{&langFilter} + filters := []*TreeRequest_Filter{{Key: "lang", Value: lang}} + if lang == "sgs" { + for _, l := range []string{"lt", "prg", "eo"} { + filters = append(filters, &TreeRequest_Filter{Key: "lang", Value: l}) + } + } path := "" tr := TreeRequest{Path: &path, Filter: filters}