Persist subtitle setting across restarts with optional fallback to first found#3301
Open
GRBaset wants to merge 2 commits into
Open
Persist subtitle setting across restarts with optional fallback to first found#3301GRBaset wants to merge 2 commits into
GRBaset wants to merge 2 commits into
Conversation
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.
Currently, the "Persist subtitles" option only works during a single session, so users have to manually enable subtitles if desired every single time the app is restarted, which is not the behavior I expected of such an option, and there's no option to make it persistent across restarts. The reason this happens is that the language of the last selected subtitles is saved to a variable but isn't persisted to storage, which I do in this PR. I didn't make it into a separate option since it doesn't seem to me that the original behavior is intended or useful.
Additionally, since users may watch videos in multiple different languages, I have added a fallback setting for when the chosen language is not found. I originally intended to add a fallback to the original video language (mirroring the original audio setting), but unfortunately the audio tracks don't seem to have an associated language, at least on YouTube. So instead I added a fallback to the first subtitles found, which seems to work as intended (falling back to the original language) in most cases. This option is disabled by default, as enabling it means subtitles will always be enabled if possible.
I believe these changes combined address issue #2706.