-
Notifications
You must be signed in to change notification settings - Fork 149
Feat: Add auto rotation setting for PWA to local storage #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
…ting Increment schema version from 19 to 20 and add migration function to support the new auto_rotate_player setting in the Settings struct. The migration automatically adds autoRotatePlayer: true to existing users' stored settings, ensuring backward compatibility when they upgrade. New users will receive this value from the Settings::default() implementation. Changes: - Update SCHEMA_VERSION constant from 19 to 20 in constants.rs - Add migrate_storage_schema_to_v20 function to env.rs - Insert v20 migration check in the migration chain - Update serialization tests in default_tokens_ext.rs This migration preserves all existing user settings while adding the new field required for PWA rotation control functionality. Relates to stremio-web#787
Fix two compilation errors introduced in the previous commit: - Add missing generic parameter to migrate_storage_schema_to_v20 function signature (TryEnvFuture -> TryEnvFuture<()>) - Add auto_rotate_player field to Settings test struct in unit_tests/serde/settings.rs These changes ensure the codebase compiles successfully and all tests pass after the v20 schema migration implementation. Relates to stremio-web#787
Fix a compilation error introduced in the previous commit: - Add autoRotatePlayer tokens to settings serialization tests This change ensure the codebase compiles successfully and all tests pass after the v20 schema migration implementation. Relates to stremio-web#787
|
hi there, thanks for the PR thank you PS: you could rename the field to something like: |
…nstead of match'), and updated field to pwa_auto_rotation
cargo fmtWarning: can't set cargo clippyChecking stremio-core v0.1.0 (/workspaces/stremio-core) cargo testCompiling stremio-core v0.1.0 (/workspaces/stremio-core) running 191 tests test result: ok. 191 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s Doc-tests stremio-core running 15 tests test result: ok. 15 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.96s cargo fmt -- --checkWarning: can't set cargo check --allCompiling stremio-derive v0.1.0 (/workspaces/stremio-core/stremio-derive) cargo clippy --all --no-depsCompiling stremio-derive v0.1.0 (/workspaces/stremio-core/stremio-derive) |
Thanks for your guidance. I had Rust v1.90 installed in the system during the previous PR. After downgrading to v1.77 all checks seemingly passed this time. I have added the output for your perusal. I have also changed field name as you suggested. |
Description
Adds
auto_rotate_playerboolean setting to control screen rotation behavior in the Stremio PWA.Changes
auto_rotate_playerfield toSettingsstruct with default valuetruedefault_tokens_ext.rsandsettings.rsTesting
Implementation Notes
This PR implements the backend portion of the rotation control feature. The setting:
true(maintains current auto-rotate behavior)Frontend implementation in stremio-web will follow to:
profile.settings.autoRotatePlayerscreen.orientation.lock('landscape')whentruescreen.orientation.unlock()whenfalseRelated Issues
Part 1 of Stremio/stremio-web/issues/787