wolfskin/app/schemas/com.github.damontecres.wholphin.data.AppDatabase
Damontecres 3ef221bf91
Improve track persistence for series & episodes (#1802)
## 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:
1. Episode specific - User has explicitly chosen an audio/subtitle track
for this episode
2. Season specific - User has chosen the track for another episode in
this season
3. Series specific - User has chosen the track for another episode in
this series
4. User preferences - User has _not_ chosen a track for the episode,
season, nor series, so determine track based on the preferred audio
language, preferred subtitle language, and subtitle mode

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, though there is no global preference
for this yet.

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

The context menu for choosing audio or subtitle tracks now displays why
that track was chosen.

### 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've done some testing on the emulator and it
seems to work well. But I think real world testing will be needed.

## AI or LLM usage
None
2026-10-16 10:53:44 -04:00
..
2.json Remember playback choices & fix some track selection issues (#26) 2025-10-17 17:19:44 -04:00
3.json Remember playback choices & fix some track selection issues (#26) 2025-10-17 17:19:44 -04:00
4.json Remember playback choices & fix some track selection issues (#26) 2025-10-17 17:19:44 -04:00
5.json Add ability to customize the navigation drawer menu (#60) 2025-10-23 15:57:26 -04:00
6.json Remember library/collection sorting (#150) 2025-11-03 12:15:41 -05:00
7.json Update device profile for Jellyfin 10.11 (#293) 2025-11-21 20:16:49 -05:00
8.json Add ability to filter libraries, collection, etc (#308) 2025-11-23 10:40:18 -05:00
9.json Customize display of library grid pages (#368) 2025-12-04 12:20:50 -05:00
10.json Add setting to protect a user profile with a PIN (#356) 2025-12-04 14:37:27 -05:00
11.json Persist audio & subtitle track changes for series if in different language (#405) 2025-12-11 10:16:45 -05:00
12.json MPV: Adjust subtitle delay/offset (#470) 2025-12-15 10:06:36 -05:00
20.json Add integration with Jellyseerr/Seerr (#558) 2026-01-12 16:35:27 -05:00
30.json Add support for viewing photos in photo albums (#703) 2026-02-04 20:04:46 -05:00
31.json Add ability to order navigation drawer items (#886) 2026-02-12 19:55:12 -05:00
32.json Add option to require server login for user profile (#1367) 2026-05-20 12:00:02 -04:00
33.json Support configuring interface language per user (#1406) 2026-05-24 09:55:08 -04:00
34.json Store remembered tabs in app database instead of preferences (#1541) 2026-06-08 13:45:38 -04:00
35.json Add option to override user profile settings for audio & subtitle languages (#1680) 2026-07-14 14:17:31 -04:00
40.json Improve track persistence for series & episodes (#1802) 2026-10-16 10:53:44 -04:00