Skip to content

Remember output and encoding settings across launches (#264) - #286

Merged
StuartCameronCode merged 2 commits into
mainfrom
stuart/135-investigate-github-issue-264
Nov 28, 2026
Merged

StuartCameronCode merged 2 commits into
mainfrom
stuart/135-investigate-github-issue-264

Conversation

@StuartCameronCode

Copy link
Copy Markdown
Owner

Fixes #264.

What changed

Output and encoding settings were kept only in MainViewModel's memory, so every launch started over at const EncodingSettings(). A chosen output folder, codec or container was gone after a restart.

  • New EncodingSettingsStore (app/lib/services/encoding_settings_store.dart). It saves the whole EncodingSettings as JSON in shared_preferences under encodingSettings. Every field is saved, Custom FFmpeg Arguments and Custom VapourSynth included. The store is loaded once in main(), 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.
  • MainViewModel starts from the stored settings. It saves from the only two places they change, updateEncodingSettings and loadPreset. Both the starting settings and the save function can be injected, for tests.
  • Loading a preset that names no output folder now keeps the current folder. Built-in presets name none, so loading one used to reset the folder to "same as input". A preset that names a folder still sets it.
  • Restored settings get the same checks as a preset. A codec/container pairing that won't work gets the dialog that already appears before a job starts. A hardware encoder that fails its check stays selectable with a warning, as before. Nothing is swapped silently.
  • CLAUDE.md has a new section on these rules, and the README has one paragraph under Presets.

Testing

  • flutter test test/encoding_settings_store_test.dart: 9/9 pass.
    • Every field survives a restart. The test first checks that each field is off its default, so the round trip covers all of them.
    • Corrupt JSON, a non-object value and an unknown codec each fall back to the defaults.
    • A change made in the view model is there after a restart.
    • A built-in preset keeps the chosen folder, and a preset with its own folder sets it.
  • flutter analyze is clean on the new and changed files.
  • I ran the push-gate Flutter suite locally after building the worker. Everything passed except 6 tests in 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

StuartCameronCode and others added 2 commits November 28, 2026 19:45
…#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]>
@StuartCameronCode
StuartCameronCode merged commit 3d9b683 into main Nov 28, 2026
8 checks passed
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.

On Mac: Output settings don't safe

1 participant