RSS slides fetch their feed twice per rotation (is_available + render) #17
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
paul_loth/krautspaceTV#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
backend/slides/rss.py'sis_available()(line 166-173) andrender()(line 176+) both independently call_fetch_text(url).rotation.py's_rotation_step()callsis_available()and then, if it returned True,render()on the very next line (backend/rotation.py:147-153) — so every time rotation reaches an RSS slide, the feed URL gets fetched twice in a row for the same content.This doubles outbound request volume to every RSS feed source for no benefit —
is_available()only needs to know "did this parse to at least one item", whichrender()re-derives from a second fetch of the same URL moments later.Suggested fix
Either:
is_available()andrender()within the same rotation step share one fetch, oris_available()to a cheap check (e.g. just confirmfeed_urlis non-empty) and letrender()be the sole place that surfaces "unable to load/parse feed" — it already renders a friendly error state for both failure cases, sois_available()gating on a full fetch+parse isn't adding much value over just always attempting to show the slide.Where
backend/slides/rss.py:166-191, called frombackend/rotation.py:139-155Fixed and deployed.
is_available()in backend/slides/rss.py now does a cheap non-network check (feed_url non-empty) instead of a full fetch+parse — render() already has a friendly error state for a broken feed, so the redundant fetch added no real value. RSS feed requests per rotation step now: 1 (was 2).