From 1bc69e1e45440bda0a005325e954630cb19da131 Mon Sep 17 00:00:00 2001 From: boypt <1033514+boypt@users.noreply.github.com> Date: Tue, 27 Jul 2021 13:13:56 +0800 Subject: [PATCH] add titles --- server/server_rss.go | 8 +------- static/files/template/omni.html | 9 ++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/server/server_rss.go b/server/server_rss.go index c59652e2..375ecf5e 100644 --- a/server/server_rss.go +++ b/server/server_rss.go @@ -177,12 +177,6 @@ func (s *Server) serveRSS(w http.ResponseWriter, r *http.Request) { results = append(results, ritem) } - b, err := json.Marshal(results) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusOK) - w.Write(b) + json.NewEncoder(w).Encode(results) } diff --git a/static/files/template/omni.html b/static/files/template/omni.html index b07820d0..d323f85e 100644 --- a/static/files/template/omni.html +++ b/static/files/template/omni.html @@ -93,16 +93,15 @@

{{ r.size }} - {{ r.seeds }} + {{ r.seeds }}
- {{ r.peers }} + {{ r.peers }} - + - +