Skip to content

fix(zones): a West channel no longer receives the unmarked East feed (#55) - #56

Merged
PiratesIRC merged 1 commit into
mainfrom
fix/issue-55-unmarked-streams-on-west
Sep 19, 2026
Merged

PiratesIRC merged 1 commit into
mainfrom
fix/issue-55-unmarked-streams-on-west

Conversation

@PiratesIRC

Copy link
Copy Markdown
Owner

Fixes #55.

What was wrong

extract_zone reads a stream name with no zone marker as DEFAULT, which its docstring calls the East feed in a US lineup, and the channel side already routes an unmarked channel as East. _order_streams_for_zone dropped only a stream literally marked EAST from a West channel, so the same feed was dropped when written INVESTIGATION CHANNEL (EAST) and kept when written INVESTIGATION CHANNEL.

Measured on the maintainer's install: STARZ (W) held 3 West rows and 6 unmarked rows, Showtime (W) held 9 West rows and 6 unmarked rows.

What changes

  • A West channel keeps West streams only. _zone_affinity_rank ranks unmarked equal to East on a West channel.
  • When no West stream matched, Match and Assign and Preview now use _streams_to_assign:
    • the channel already holds streams: nothing is added and nothing is removed, in both Overwrite modes (appending would add the wrong feed; replacing with an empty list would take the channel off the air);
    • the channel holds no streams: the other-zone streams are assigned, with a logged warning, as before.
  • Sort keeps the keep-everything fallback, because it deletes and recreates a channel's rows from the list.
  • A lone West-named channel with no sibling is still not zone-routed, so it is unaffected.

Tests

tests/test_issue_55_west_unmarked.py (13 tests), plus four existing tests rewritten because they asserted the old behaviour. Full suite: 1547 passed. Each guard was removed in turn and a named test failed each time; a comment-only change left the suite green.

Effect on the maintainer's install once deployed

The daily Sort will remove the 12 unmarked rows from STARZ (W) and Showtime (W); both keep their West streams. No other West channel is affected.

🤖 Generated with Claude Code

…55)

extract_zone reads an unmarked stream name as DEFAULT, which its own
docstring calls the East feed, and the channel side already routes an
unmarked channel as East. The stream side dropped only a stream literally
marked EAST from a West channel, so the same feed was dropped when the
provider wrote "(EAST)" and kept when it did not. Measured on the
maintainer's box: STARZ (W) and Showtime (W) each held 6 unmarked rows
beside their West feeds.

- A West channel keeps West streams only; unmarked ranks with EAST.
- When no West stream matched, Match and Assign (and Preview) leave a
  channel that already holds streams untouched in both Overwrite modes,
  and give the other-zone streams only to a channel holding none.
- Sort keeps the keep-everything fallback, since it replaces the list.

Fixes #55

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@PiratesIRC
PiratesIRC merged commit 8e17579 into main Sep 19, 2026
6 checks passed
@PiratesIRC
PiratesIRC deleted the fix/issue-55-unmarked-streams-on-west branch September 19, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unmarked streams are attached to WEST channels

1 participant