nandi/gleanpublic⑂ Fork 0
⑂ 097e22b
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

LintingUnverified

Julien Robert committed 2026-04-21T16:21:33+02:00 Browse files
097e22b parent: 9255228
modified internal/atproto/xrpc.go +3 -6
@@ -301,10 +301,7 @@ func (h *XRPCHandler) GetTrending(w http.ResponseWriter, r *http.Request) {
301301
302302 func (h *XRPCHandler) GetRecommendations(w http.ResponseWriter, r *http.Request) {
303303 repo := r.URL.Query().Get("repo")
304- limit := parseIntParam(r, "limit", 20)
305- if limit > 50 {
306- limit = 50
307- }
304+ limit := min(parseIntParam(r, "limit", 20), 50)
308305
309306 feedRows, err := h.db.QueryContext(r.Context(), `
310307 SELECT r.feed_url, f.title, f.site_url, f.description, f.subscriber_count, r.score
@@ -423,8 +420,8 @@ func (h *XRPCHandler) ListFeedLists(w http.ResponseWriter, r *http.Request) {
423420
424421 feedLists := make([]FeedListEntry, 0)
425422 type userRow struct {
426- did string
427- subCount int
423+ did string
424+ subCount int
428425 }
429426 var users []userRow
430427
@@ -301,10 +301,7 @@ func (h *XRPCHandler) GetTrending(w http.ResponseWriter, r *http.Request) {
301 301
302 func (h *XRPCHandler) GetRecommendations(w http.ResponseWriter, r *http.Request) {302 func (h *XRPCHandler) GetRecommendations(w http.ResponseWriter, r *http.Request) {
303 repo := r.URL.Query().Get("repo")303 repo := r.URL.Query().Get("repo")
304- limit := parseIntParam(r, "limit", 20)304+ limit := min(parseIntParam(r, "limit", 20), 50)
305- if limit > 50 {
306- limit = 50
307- }
308 305
309 feedRows, err := h.db.QueryContext(r.Context(), `306 feedRows, err := h.db.QueryContext(r.Context(), `
310 SELECT r.feed_url, f.title, f.site_url, f.description, f.subscriber_count, r.score307 SELECT r.feed_url, f.title, f.site_url, f.description, f.subscriber_count, r.score
@@ -423,8 +420,8 @@ func (h *XRPCHandler) ListFeedLists(w http.ResponseWriter, r *http.Request) {
423 420
424 feedLists := make([]FeedListEntry, 0)421 feedLists := make([]FeedListEntry, 0)
425 type userRow struct {422 type userRow struct {
426- did string423+ did string
427- subCount int424+ subCount int
428 }425 }
429 var users []userRow426 var users []userRow
430 427