| @@ -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.score | 307 | 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 string | 423 | + did string |
| 427 | - subCount int | 424 | + subCount int |
| 428 | } | 425 | } |
| 429 | var users []userRow | 426 | var users []userRow |
| 430 | | 427 | |