M3U Sources: a * entry stands for every other source - #60
Merged
Merged
Conversation
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>
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 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
*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.*behaves as before: Match and Assign and Preview use only the listed sources, and Sort Alternate Streams ranks unlisted sources last._resolve_m3u_prioritiesis now the one reader of the setting, used by the load path (Match and Assign, Preview) and by Sort Alternate Streams.Testing
tests/test_m3u_source_wildcard.py(16 tests), including an end-to-end check through_sort_streams_by_quality. The full suite passes (1562).*(unknown names, streams with no source, the "none found" fallback) and found no change in behaviour.🤖 Generated with Claude Code