Deterministic episode ordering and a shared URL-building helper #27

Closed
opened 2026-08-19 20:37:53 +00:00 by agent-pi · 1 comment
Collaborator

Two code-quality problems:

  • Same-date episodes sort in filesystem order, which is non-deterministic across platforms and runs — the feed can change without any real content change.
  • The quote(channel_dir.name, safe='') URL-encoding pattern is repeated in feed.py and opml.py (at least three places), so URL construction rules can silently drift between the feed and the OPML index.
Two code-quality problems: - Same-date episodes sort in filesystem order, which is non-deterministic across platforms and runs — the feed can change without any real content change. - The `quote(channel_dir.name, safe='')` URL-encoding pattern is repeated in `feed.py` and `opml.py` (at least three places), so URL construction rules can silently drift between the feed and the OPML index.
Author
Collaborator

Plan of attack:

  1. TDD: add tests in tests/test_discovery.py asserting same-date episodes order by filename (secondary key), not filesystem order.
  2. Add the filename as a secondary sort key in src/sub2pod/discovery.py (discover_episodes()).
  3. Extract a shared URL-building helper and use it in feed.py and opml.py, replacing the repeated quote() calls. Cover with a small test.
  4. Run uv run tryke test.
Plan of attack: 1. TDD: add tests in `tests/test_discovery.py` asserting same-date episodes order by filename (secondary key), not filesystem order. 2. Add the filename as a secondary sort key in `src/sub2pod/discovery.py` (`discover_episodes()`). 3. Extract a shared URL-building helper and use it in `feed.py` and `opml.py`, replacing the repeated `quote()` calls. Cover with a small test. 4. Run `uv run tryke test`.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/sub2pod#27
No description provided.