Improve track persistence for series & episodes - #1802
Conversation
Code compiles but is untested No PLC->STC migration yet
|
It worked, thank you! |
|
Hello, I’ve just switched from the official client to your version due to various bugs and design issues—but primarily because of the poor handling of audio and subtitle streams. I hope this fix meets my expectations. Thanks a lot for your efforts in this area. Edit: This not retain the current audio codec type for example and i am still in "default" mode. I just tested this branch, and it still doesn't quite meet my expectations, even though it's getting closer. By default: "Smart mode" should behave roughly the same way but must check each item to see if the streams (audio/subtitles) match the user's preferences (this allows, for instance, reverting to the correct language and subtitles when switching from a multi-language episode to a single-language one, and then back to content in your preferred language). However, note that if the audio language matches your preferred language, the system should select the forced subtitle track—or no subtitles at all if only full subtitle tracks exist. "Always default" mode always loads the default audio streams but still attempts to adjust the subtitles (e.g., if a default subtitle track exists but isn't marked as "forced" while the audio language matches, the subtitle track should not be loaded). There are many possible variations, but your implementation of modes and languages based on server settings certainly facilitates the integration of an audio and subtitle manager. I should point out that all indicators and their variants must be taken into account to implement the best possible fallbacks. |
Caution
This is a work in progress! There may be bugs!!
Description
This PR overhauls how audio and subtitle track persistence works for series! Previously, when you chose an audio or subtitle track for an episode, only the language was saved and used for subsequent episodes. This meant aspects about why that choice were lost such as a forced or hearing impaired track.
This PR changes the persistence to include more details about the chosen track. Additionally, the persistence is saved at both the season and series levels.
How it works
Selecting the track uses the first success option:
Additionally, the season or series specific choices use a scoring algorithm to find the best suited track. For example, if the chosen tracks for an episode in the season had the forced flag, this will be preferred for subsequent episodes. Same for SDH/hearing impaired or title, etc. This means that the common case where a season has substantially identical tracks will use the same ones across all episodes (after choosing for one, otherwise falling back to the series or user preferences).
Finally, this also means that users that prefer SDH/hearing impaired subtitles can be prioritized now.
The previous track language choices are migrated to the new algorithm. They lack the additional context, but this makes for a seamless transition.
UI changes
Still WIP, but the context menu for choosing audio or subtitle tracks now displays why that track was chosen
TODO
Related issues
Fixes #1795
Maybe fixes #1783
Related to #1136 & #1798
Closes #1470
Testing
Previous unit tests for track selection all pass, plus there are a few additional unit tests
I did basic tests with the emulator, but this needs a lot more
Screenshots
AI or LLM usage
None
Try it out
You can try this unstable development branch by following the instructions here: https://github.com/damontecres/Wholphin/releases/tag/develop-episode-track-persist
Note: this PR contains database changes!! This means if you install this branch, you CANNOT switch to another development branch nor stable unless you uninstall the app first!! The app will not start otherwise!