Changes to the compse yml and the way and amout of artikeltexte are delivered and taht not duplicates are displayed

This commit is contained in:
hubble_dubble
2026-01-26 01:09:20 +00:00
parent 71ff9344a1
commit 53e5bc500f
2 changed files with 36 additions and 8 deletions

View File

@@ -207,9 +207,20 @@ func main() {
rows, err := conn.Query(r.Context(), `
SELECT article_id, title, link, summary, image, published_at
FROM articles
WHERE image IS NOT NULL
ORDER BY COALESCE(published_at, created_at) DESC
FROM (
SELECT DISTINCT ON (COALESCE(article_id, link, title))
article_id,
title,
link,
summary,
image,
published_at,
COALESCE(published_at, created_at) AS sort_ts
FROM articles
WHERE image IS NOT NULL
ORDER BY COALESCE(article_id, link, title), COALESCE(published_at, created_at) DESC
) deduped
ORDER BY sort_ts DESC
LIMIT 20
`)
if err != nil {