Sources table: Media column (image coverage % + paywall marker)
Per Codex — make the table more decision-ready from data we already have. Paywall is a domain-level hint, so it's a per-source flag (not a meaningful rate): show image-coverage % plus a 🔒 marker for subscription domains in one compact "Media" column (tooltip spells it out). source_health gains a `paywalled` flag (is_paywalled on homepage/feed); also added to sources.csv. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import sqlite3
|
||||
from datetime import UTC, datetime, timedelta
|
||||
|
||||
from .feeds import MAX_BACKOFF_MINUTES
|
||||
from .paywall import is_paywalled
|
||||
|
||||
# Composite ranking used everywhere a "best first" order is needed. Kept as one
|
||||
# expression so brief, category feeds, and the API all rank identically.
|
||||
@@ -332,6 +333,8 @@ def source_health(conn: sqlite3.Connection) -> list[dict]:
|
||||
# duplicate of content already served (accepted_total − served = accepted dupes).
|
||||
d["accepted_dup_rate"] = round(100 * (accepted - d["served"]) / accepted) if accepted else None
|
||||
d["image_coverage"] = round(100 * (d["images"] or 0) / d["served"]) if d["served"] else None
|
||||
# Paywall is a domain-level hint, so it's a per-source flag (not a rate).
|
||||
d["paywalled"] = is_paywalled(d.get("homepage_url") or d.get("feed_url"))
|
||||
# Match the REAL scheduler gate: due = the later of the streak-backoff time
|
||||
# and any retry_after_at rest (UTC strings sort chronologically).
|
||||
due_times = [t for t in (d["next_due_at"], d["retry_after_at"]) if t]
|
||||
|
||||
Reference in New Issue
Block a user