chore: filter out perma dead

This commit is contained in:
xuu 2025-03-29 22:18:43 -06:00
parent 07aba6d14a
commit 2bb2eec993
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F

12
http.go
View File

@ -114,8 +114,8 @@ func httpServer(ctx context.Context, app *appState) error {
defer span.End()
args := make([]any, 0, 3)
where := ``
where := `where feed_id in (select feed_id from feeds where state != 'permanantly-dead')`
uri := r.URL.Query().Get("uri")
if uri != "" {
feed_id := urlNS.UUID5(uri)
@ -135,7 +135,7 @@ func httpServer(ctx context.Context, app *appState) error {
var end int64
err = db.QueryRowContext(ctx, `
select count(*) n from twts `+where, args...).Scan(&end)
select count(*) n from twts `+where+``, args...).Scan(&end)
span.RecordError(err)
if offset < 1 {
@ -162,9 +162,9 @@ func httpServer(ctx context.Context, app *appState) error {
coalesce(uri, 'https://empty.txt') uri,
text
FROM twts
left join (
join (
select feed_id, nick, uri
from feeds
from feeds
) using (feed_id)
where rowid in (
select rowid from twts
@ -174,7 +174,7 @@ func httpServer(ctx context.Context, app *appState) error {
offset ?
)
order by ulid asc`
fmt.Println(qry, args)
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
rows, err := db.QueryContext(