fix(player): preserve the forced-subtitle class across episode boundaries

Plex treats a subtitle stream as forced when its title says "Forced" even
with the API flag unset. Every forced comparison now uses that effective
forced-ness on both sides: the match scorer, the low-metadata hard gate,
the Jellyfin OnlyForced/Smart profile modes, and stream-index negotiation.

Carrying a track choice into the next episode no longer reuses the
same-item identity matchers. A sealed SubtitlePreference (off / track
reference / semantic intent) replaces the id-'navigation' pseudo-track
through the whole preference channel, and cross-item intents hard-require
language and forced-class parity. When the next episode has no track of
the same class, the intent declines and selection falls through to the
server's own per-episode choice instead of latching onto a full track by
position and persisting that mistake back to the server.

Intents wait for pending native tracks under the same catalog-completeness
rule as source ids, so an early decline cannot retire the selection
listener before the real track arrives.

Ref #1716
This commit is contained in:
edde746
2026-07-30 02:46:10 +02:00
parent f13f5af6e2
commit daab4f1e24
22 changed files with 921 additions and 231 deletions
+18
View File
@@ -17,6 +17,24 @@ void main() {
});
});
group('titleSaysForced', () {
test('matches the forced token anywhere in the title', () {
expect(titleSaysForced('Forced'), isTrue);
expect(titleSaysForced('FORCED'), isTrue);
expect(titleSaysForced('FR Forced [ASS]'), isTrue);
expect(titleSaysForced('French (Forced)'), isTrue);
expect(titleSaysForced('forced.eng'), isTrue);
});
test('requires a whole token, not a substring', () {
expect(titleSaysForced('unforced'), isFalse);
expect(titleSaysForced('Reinforced'), isFalse);
expect(titleSaysForced('French'), isFalse);
expect(titleSaysForced(''), isFalse);
expect(titleSaysForced(null), isFalse);
});
});
group('resolveTrackLanguageDisplay', () {
test('resolves 2-letter, 3-letter, and bibliographic codes', () {
expect(resolveTrackLanguageDisplay(language: 'en'), 'English');