Skip to content

M3U Sources: a * entry stands for every other source - #60

Merged
PiratesIRC merged 1 commit into
mainfrom
feat/m3u-source-wildcard
Sep 25, 2026
Merged

PiratesIRC merged 1 commit into
mainfrom
feat/m3u-source-wildcard

Conversation

@PiratesIRC

Copy link
Copy Markdown
Owner

What was wrong

A user wanted streams from one free provider first and any other provider when the free one has nothing, without naming every provider. Naming only the free provider made Match and Assign use only that provider: in Match and Assign and Preview the M3U Sources list filters as well as sets the order. Listing every provider works until a new provider is added and the list is not updated.

What this changes

  • A * entry in M3U Sources stands for every source not named. No source is dropped. Named sources rank in the order written and every other source takes the position of the *:
    • Free Provider, *: Free Provider first, every other source after it, including ones added later.
    • *, Backup: every other source first, Backup last.
  • A list without * behaves as before: Match and Assign and Preview use only the listed sources, and Sort Alternate Streams ranks unlisted sources last.
  • _resolve_m3u_priorities is now the one reader of the setting, used by the load path (Match and Assign, Preview) and by Sort Alternate Streams.
  • A source named twice keeps its first position (before, a repeat moved it to its last position). Names that match no account are logged, and the Sort log no longer gives them a priority number.
  • Help text, the README settings row and the CSV header describe the wildcard.

Testing

  • New tests/test_m3u_source_wildcard.py (16 tests), including an end-to-end check through _sort_streams_by_quality. The full suite passes (1562).
  • Ignoring the wildcard, ranking it last, keeping a repeat at its last position, and Sort ignoring the wildcard each make at least one test fail.
  • The workspace release gate passes all 9 gates on this branch. An independent review compared old and new code for lists without * (unknown names, streams with no source, the "none found" fallback) and found no change in behaviour.

🤖 Generated with Claude Code

A user wanted one free provider first and any other provider when it has
nothing, without naming every provider. Naming only the free provider made
Match and Assign use ONLY that provider, because in Match and Assign and
Preview the list filters as well as orders.

With * in the list no source is dropped. Named sources rank in the order
written and every unnamed source takes the position of the *:
"Free Provider, *" ranks Free Provider first and everything else after it,
including sources added later; "*, Backup" ranks Backup last. Without a *
nothing changes.

- _resolve_m3u_priorities is now the one reader of the setting, used by the
  load path (Match and Assign, Preview) and by Sort Alternate Streams.
  _apply_m3u_priorities filters and stamps _m3u_priority; _m3u_priority_for
  gives one source's priority.
- A repeated entry now counts once at its first position (before, a repeat
  moved the source to its last position). Names that match no account are
  logged on the load path, and the Sort priority log no longer numbers them.
- Help text, README settings row and the CSV header describe the wildcard.

Tests: tests/test_m3u_source_wildcard.py (16). Ignoring the wildcard,
ranking it last, taking a repeat at its last position, and Sort ignoring the
wildcard each fail at least one test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@PiratesIRC
PiratesIRC merged commit 77a09f8 into main Sep 25, 2026
6 checks passed
@PiratesIRC
PiratesIRC deleted the feat/m3u-source-wildcard branch September 25, 2026 12:08
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.

1 participant