Repository navigation
fix: read a country before a left quarter block separator - #69
Merged
PiratesIRC merged 1 commit intoOct 29, 2026
Merged
PiratesIRC merged 1 commit into
PiratesIRC merged 1 commit into
Conversation
Some providers separate the country from the rest of a group or stream
name with U+258E LEFT ONE QUARTER BLOCK ("NL ▎NEDERLAND HD") instead of
a pipe or a box bar. The character was not in the delimiter set, so
none of those names produced a country. Restrict Matching To Same
Country then treated every such stream as unknown and kept it, which
put Belgian and German feeds on Dutch channels.
Add the character to the token delimiter. It is never used as a pair,
so the wrapped form is unchanged.
Name matching already strips the spaced form ("NL ▎RTL 4" matches as
"RTL 4"). The unspaced form ("DE▎ZDF") keeps its country token there,
but that pattern lives in the vendored matching core, so it is not
changed here.
Owner
|
Thanks, this is a clean fix. I ran the full suite locally (1786 passed) and confirmed the three new cases fail without the change. Merging now; it will go out in the next release. You are right about |
PiratesIRC
added a commit
that referenced
this pull request
Oct 29, 2026
pytest 9.2.0 undoes monkeypatch.setattr(<MagicMock>, "objects", ...) by deleting the attribute, so every later test that read ChannelProfileMembership.objects on the shared stub failed (9 tests, CI on main since the PR #69 merge). Patch the module attribute with a fresh MagicMock instead; undoing that restores the shared stub untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Q5fkaJ73nXCNUcFxJTvQm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A country written before U+258E LEFT ONE QUARTER BLOCK (
NL ▎NEDERLAND HD,BE ▎DISCOVERY CHANNEL HD) is now recognised by the country filter, the same wayNL |and┃NL┃already are.Why
One of my providers separates the country from the rest of every group and stream name with
▎instead of a pipe or a box bar. The character was not in_DELIM, so none of those names produced a country. With Restrict Matching To Same Country on, every such stream came out unknown and was kept, so Belgian and German feeds still landed on Dutch channels.How it was verified
python -m pytest -qpasses (1786 passed, 1 skipped: the plugin-stats sibling checkout)The new tests in
tests/test_country_detection.pycoverNL ▎,BE ▎,DE▎(no space) andUK ▎, through bothcountry_from_nameandcountry_from_group, plusPPV ▎,UEFA ▎andMULTI ▎, which must stay unknown. Three of them fail without the change;UK ▎already passed through the bare-code rule.On my own group names (343 groups across three providers), the provider that uses
▎went from 0 groups with a country to 933 streams detected as NL and 153 as BE. What is left unknown there is genuinely country-less (PPV,UEFA,MULTI,FORMULA 1). The other two providers are unchanged.Anything a reviewer should know
▎only goes into_DELIM, not into the wrapped form, because it is never used as a pair.NL ▎RTL 4 HDnormalises toRTL 4. The unspaced formDE▎ZDF HDkeeps its country token there (DE ZDF), becausePROVIDER_PREFIX_PATTERNSinmatching_core.pydoes not list▎either. That file is vendored and hash-pinned, so I left it alone. If you want both sides to agree, it would need▎in that pattern in_shared/. All the names I have put a space before the character, so I could not test the unspaced case against real data.addresses appear in the diff, the description, or any attached output.
python scripts/bump_version.py, orthis change does not need a version bump. (Not bumped; I left that to the release.)