Add Preferred Max Quality setting and refactor Auto-Play logic#49
Closed
EierKopZA wants to merge 7 commits intoProdigyV21:mainfrom
Closed
Add Preferred Max Quality setting and refactor Auto-Play logic#49EierKopZA wants to merge 7 commits intoProdigyV21:mainfrom
EierKopZA wants to merge 7 commits intoProdigyV21:mainfrom
Conversation
Contributor
Author
|
Hey! While testing the other features, I noticed a couple of navigation bugs and pushed two quick QoL (Quality of Life) fixes to this branch: Watchlist Focus Trap: Refined the grid bounds using onPreviewKeyEvent so the D-pad no longer gets permanently stuck inside the grid when trying to navigate Left or Up to the sidebar/top bar. Search Navigation: Swapped remember to rememberSaveable for the Search focusZone so the app remembers you were in the results list when pressing back from the Details screen, instead of resetting to the keyboard. |
…nd auto-play filtering - Add StreamQualityUtils.kt with centralized quality detection logic - Check filename first (most reliable), then fall back to provider metadata - Fixes issue where provider metadata (e.g., Torrentio) mislabels 1080p files as 4K - Update StreamSelector for accurate quality badge display - Update SourceInfoOverlay for correct player quality info - Update DetailsScreen auto-play filtering to use hybrid detection - Update PlayerViewModel and PlayerScreen for consistent quality handling - Ensures quality badges, filtering, and auto-play all use same reliable logic - Zero breaking changes - fully backward compatible This resolves the visual inconsistency where badges showed bad metadata while auto-play correctly filtered streams, by making both use the same hybrid detection.
775df79 to
2a157f6
Compare
Owner
|
Am still looking into this, will see to it for 1.9.5 |
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.
Settings UI: Added a new toggle in Settings > General (Index 10) below the Min Quality setting. Users can cycle through Any, 720p, 1080p, and 4K.
State Management: Integrated the setting into SettingsViewModel and DetailsViewModel via DataStore for persistent user preference.
Cloud Sync: Added the new preference to CloudSyncRepository to ensure quality limits sync across devices.
The Issue: The previous logic used broad string matching (e.g., .contains("4K")), which caused "fake 4K" links—like those labeled DS4K (Downsampled 4K)—to be misidentified as 2160p and blocked when a 1080p limit was set.
The Fix: * Implemented word-boundary Regex (\b) in the scoring logic to accurately identify resolutions and ignore false positives.
Updated the LaunchedEffect to use a strict range filter: score in minThreshold..maxThreshold.
The app now ignores any stream exceeding the user's "ceiling" and automatically selects the highest available stream within the allowed range.
Developer Notes
While the Auto-Play logic is now robust and correctly identifies/filters streams based on the filename, there is still a visual inconsistency in the UI badges within StreamSelector.kt and SourceInfoOverlay.kt. Some 1080p files are still rendering with an orange "4K" badge due to the provider's metadata. The engine ignores these for auto-play correctly, but a final Regex pass on the UI components would be beneficial to align the badges with the now-fixed selection logic.
How to test
Go to Settings > General and set Preferred Max Quality to 1080p.
Open a title with multiple resolutions (e.g., Zootopia 2).
Verify that auto-play successfully bypasses 2160p/4K links and starts a 1080p link instead.
Set the limit to 720p and verify it downshifts the selection further.