Deterministic episode ordering and shared URL helpers #34
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/issue-27-deterministic-sort-url-helper"
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 #27
Two code-quality improvements:
discover_episodes()now uses the filename as a secondary sort key, so episodes sharing a date sort deterministically instead of in filesystem order.build_channel_url()andbuild_file_url()into a newsub2pod/urls.py, replacing the repeatedquote(channel_dir.name, safe='')/base_url.rstrip('/')pattern infeed.pyandopml.py.Covered by Tryke tests (red → green), including a new
tests/test_urls.pyfor the helper and a same-date determinism test intests/test_discovery.py.WuMing
Found 3 issue(s). See inline comments below.
@ -8,3 +10,4 @@---Episodes that share a publication date now come back in a consistent, predictable order instead of whatever order the filesystem happened to return. If you regenerated a feed and the episode list seemed to shuffle for no reason, this fixes it.docs [LOW]
The pronoun "this" in "this fixes it" lacks a clear antecedent. It is not obvious whether it refers to the episode list, the ordering behavior, or the release itself. Consider writing "this change fixes it" or "this release fixes it."
@ -11,3 +10,4 @@from sub2pod.discovery import Episodefrom sub2pod.nfo import ChannelInfofrom sub2pod.urls import build_file_urltests [LOW]
feed.py URL construction was refactored to use build_file_url, but no test file for feed.py appears in the diff. Add or update feed tests to verify generated file/artwork URLs still use the helper correctly.
@ -7,3 +6,4 @@from lxml import etree # ty: ignore[unresolved-import]from sub2pod.nfo import ChannelInfofrom sub2pod.urls import build_channel_urltests [LOW]
opml.py URL construction was refactored to use build_channel_url, but no test file for opml.py appears in the diff. Add or update an OPML test asserting the generated outline feed URLs after the refactor.
WuMing review — 1 fixed, 2 declined
Release-Notes.mdline 13✅ Fixed in commit
5fbfa24— reworded to "this change fixes it".src/sub2pod/feed.pyline 13🔴 Declined — the refactor is already covered.
tests/test_urls.py(new, in this diff) directly testsbuild_file_url()/build_channel_url(), andtests/test_feed.py'sbuild_enclosure_urltests still assert the percent-encoded URLs end-to-end. The full 118-test suite passes against the refactored code.src/sub2pod/opml.pyline 9🔴 Declined —
tests/test_opml.py'stest_percent_encodingassertsxmlUrl == "https://pod.example.com/Links%20%26%20Friends/feed.xml", which is exactlybuild_channel_url()+/feed.xml. That test passes against the refactored code.WuMing
Found 1 issue(s). See inline comments below.
@ -3,3 +3,3 @@---sub2pod 0.3.1sub2pod 0.3.4docs [MEDIUM]
The previous version in this file is 0.3.1, but this change bumps it to 0.3.4, skipping 0.3.2 and 0.3.3. If this PR is the next release, it should probably be 0.3.2, or the release notes need entries for the missing intermediate versions.
Release-Notes.mdline 5🔴 Declined — 0.3.2, 0.3.3, and 0.3.4 are all already released (see git tags / CHANGELOG).
pyproject.tomlis at0.3.4; theRelease-Notes.mdintro was simply stale at0.3.1. I synced it to the current version per the project rule ("update the version in the intro from pyproject.toml if it has changed"). The next release will be 0.3.5 viajust release, not 0.3.2.