You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(player): add source regex filter to source priority - #3279
Adds an optional regex filter to the existing source priority system. Matching sources sort first; non-matching remain visible. Integrates with existing priority — no separate settings screen.
Changes
QualityDataHelper.kt: new SourceRegex and SourceRegexPriority settings.
PlayerGeneratorViewModel.kt: sortLinks() applies regex as sort key. Cache key includes regex.
SourcePriorityDialog.kt: inline regex input with -/+ priority. Validates on save.
Layout XMLs + strings.xml: compact regex row, 2 new strings.
Minimal diff (6 files). No new dependencies. Invalid/empty regex falls back to normal order. Regex never hides sources.
Why is this useful? I think such a setting is not really user-friendly and thus not very helpful.
There are three reasons.
Users who prefer a specific language such have to select the right source manually every time. Regex automatically sorts matching sources to the top. Set it once and it works everywhere.
Sources often include quality tags in their names such as webdl,hevc. Regex allows users to prioritize these sources without scrolling through more than thirty options during each playback.
It is built into the existing priority dialog,It is optional and works normally when left empty. It never hides any sources. There are no new screens or concepts to learn.
There are separate quality and language fields in ExtractorLink. It is probably much more reliable to use them instead of using a regex on the full name.
There are separate quality and language fields in ExtractorLink. It is probably much more reliable to use them instead of using a regex on the full name.
Correct me if I am wrong here but ExtractorLink has no language field and AudioFile only has URL and headers so regex on the name is the simplest option for language matching. Adding a default audio field would require changes across multiple components. The dev asked to keep diffs minimal so I kept it simple.
This branch has not been deployed
No deployments
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
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.
Adds an optional regex filter to the existing source priority system. Matching sources sort first; non-matching remain visible. Integrates with existing priority — no separate settings screen.
Changes
QualityDataHelper.kt: newSourceRegexandSourceRegexPrioritysettings.PlayerGeneratorViewModel.kt:sortLinks()applies regex as sort key. Cache key includes regex.SourcePriorityDialog.kt: inline regex input with -/+ priority. Validates on save.strings.xml: compact regex row, 2 new strings.Minimal diff (6 files). No new dependencies. Invalid/empty regex falls back to normal order. Regex never hides sources.