RSS feed generation (Phase 4) #8
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/8/head"
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?
Closes #7
Implements feed.xml generation: RSS 2.0 + iTunes namespace, enclosure URL construction with percent-encoding, MIME type mapping, artwork linking, and write_feed() entry point.
ROADMAP.md Phase 4 items marked complete.
src/sub2pod/feed.pyline 2 — @wuming[bot]🔴 No action needed.
pyproject.tomlsetsrequires-python = ">=3.12", soUTC(added in 3.11) is always available.timezone.utcwould be a needless downgrade.src/sub2pod/feed.pyline 8 — @wuming[bot]🔴 No action needed.
tyis the type checker used in this project (not mypy).# ty: ignore[...]is ty's inline suppression syntax — it is correct and effective. See the existingnfo.py:7for the same pattern on the same import.src/sub2pod/feed.pyline 74 — @wuming[bot]🔴 No action needed for Phase 4.
ChannelInfo(parsed fromtvshow.nfo) only carriestitleandgenre— there is no channel website URL in the data model. Usingbase_urlis the closest available value and keeps the mandatory<link>element non-empty. A dedicated website URL field can be added toChannelInfoin a later phase if needed.src/sub2pod/feed.pyline 75 — @wuming[bot]🔴 No action needed.
ChannelInfohas no description field —tvshow.nfodoes not contain a channel synopsis. RSS 2.0 mandates<description>be present and non-empty, so falling back totitleis the only viable option with the current data model. Adescriptionfield can be added toChannelInfoif a suitable NFO source element is identified.src/sub2pod/feed.pyline 119 — @wuming[bot]🔴 No action needed.
discover_episodes()only yieldsEpisodeobjects for files whose suffix is in_AUDIO_SUFFIXES = frozenset({'.opus', '.mp3', '.m4a'}), which is exactly the set thatmime_type_for_audio_filehandles.ValueErrorcannot be reached on anyEpisodeproduced by normal usage. Adding a catch here would silently swallow a bug; the raise is intentional as a safety net for future call sites.src/sub2pod/feed.pyline 123 — @wuming[bot]✅ Fixed in commit
fc539b5—_append_episode_itemnow callsepisode.audio_path.stat().st_size(with a 0 fallback if the file does not exist) and setslengthto the real byte count. A new test"enclosure length reflects actual file size in bytes"verifies this with a 4096-byte fixture file.