Skip to content

feat(player): add source regex filter to source priority - #3279

Open
forbiders wants to merge 1 commit into
recloudstream:masterfrom
forbiders:regex-patch
Open

forbiders wants to merge 1 commit into
recloudstream:masterfrom
forbiders:regex-patch

Conversation

@forbiders

Copy link
Copy Markdown

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.

Implemented with AI assistance.

@Bnyro

Bnyro commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Why is this useful? I think such a setting is not really user-friendly and thus not very helpful.

@forbiders

Copy link
Copy Markdown
Author

Why is this useful? I think such a setting is not really user-friendly and thus not very helpful.

There are three reasons.

  1. 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.
  2. 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.
  3. 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.

@Bnyro

Bnyro commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

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.

@forbiders

Copy link
Copy Markdown
Author

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
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.

2 participants