Repository navigation
Remember output and encoding settings across launches (#264) - #286
Merged
Merged
Conversation
…#264) EncodingSettings (codec, container, quality, audio, colour format, output folder, filename pattern, ProRes options, cache override, custom FFmpeg arguments and custom VapourSynth) lived only in MainViewModel's memory, so every launch started from the defaults. EncodingSettingsStore keeps them in shared_preferences under `encodingSettings`: loaded in main() before the view model exists, saved from updateEncodingSettings and loadPreset. Unreadable or unrecognised JSON falls back to the defaults. Loading a preset that names no output folder now keeps the folder the user chose; built-in presets name none, so picking one reset it to "same as input". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Fixes #264.
What changed
Output and encoding settings were kept only in
MainViewModel's memory, so every launch started over atconst EncodingSettings(). A chosen output folder, codec or container was gone after a restart.EncodingSettingsStore(app/lib/services/encoding_settings_store.dart). It saves the wholeEncodingSettingsas JSON in shared_preferences underencodingSettings. Every field is saved, Custom FFmpeg Arguments and Custom VapourSynth included. The store is loaded once inmain(), before the view model is created. Corrupt JSON, or an enum value this build doesn't know (say, a codec a newer version saved), falls back to the defaults and never stops the app starting.MainViewModelstarts from the stored settings. It saves from the only two places they change,updateEncodingSettingsandloadPreset. Both the starting settings and the save function can be injected, for tests.Testing
flutter test test/encoding_settings_store_test.dart: 9/9 pass.flutter analyzeis clean on the new and changed files.vapoursynth_integration_test: vspipe couldn't load libfftw3f from the deps bundle downloaded into that local checkout. Those tests run vspipe directly and don't touch this change, so CI will check them against the published bundle.🤖 Generated with Claude Code