Exclude skip status domains from default API listing

When no status filter is provided, the domains API now excludes
domains with 'skip' status (including bare TLDs) by default.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
primal
2026-01-29 22:34:24 -05:00
parent edce82f1af
commit 43916c8042
+4
View File
@@ -78,6 +78,7 @@ func (c *Crawler) handleAPIDomains(w http.ResponseWriter, r *http.Request) {
LIMIT $2 OFFSET $3
`, status, limit, offset)
} else {
// Default: exclude 'skip' status domains
rows, err = c.db.Query(`
SELECT d.host, d.tld, d.status, d.last_error, f.feed_count
FROM domains d
@@ -86,6 +87,7 @@ func (c *Crawler) handleAPIDomains(w http.ResponseWriter, r *http.Request) {
FROM feeds
GROUP BY source_host
) f ON d.host = f.source_host
WHERE d.status != 'skip'
ORDER BY d.tld ASC, d.host ASC
LIMIT $1 OFFSET $2
`, limit, offset)
@@ -104,6 +106,7 @@ func (c *Crawler) handleAPIDomains(w http.ResponseWriter, r *http.Request) {
LIMIT $2 OFFSET $3
`, status, limit, offset)
} else {
// Default: exclude 'skip' status domains
rows, err = c.db.Query(`
SELECT d.host, d.tld, d.status, d.last_error, COALESCE(f.feed_count, 0) as feed_count
FROM domains d
@@ -112,6 +115,7 @@ func (c *Crawler) handleAPIDomains(w http.ResponseWriter, r *http.Request) {
FROM feeds
GROUP BY source_host
) f ON d.host = f.source_host
WHERE d.status != 'skip'
ORDER BY d.tld ASC, d.host ASC
LIMIT $1 OFFSET $2
`, limit, offset)