Sort streams with a missing Index to the end of the menu (not to the top via 0,
which collides with a real Index 0). Reword the native ff-index comment to say
it is exposed for future/diagnostic use, not consumed by the current resolver.
Revert the incidental edit to the unused TVSubtitleSheet (removed separately in
the dead-code PR #1780).
Group-ordinal within the same-identity set (a preceding different-language
track no longer makes the first duplicate unreachable), exclude server-burned
(Encode) streams from the embedded ordinal and signal them as burnedIn, match
languages across ISO 639-1/639-2 B-T/IETF variants, and sort the menu by the
raw IsExternal flag so the order stays stable between direct play and transcode.
Adds getExternalSubtitleUrl as the single source of truth for the external-sub
URL, and short-circuits disable/burnedIn before enumerating the track list.
- Unify external detection: isExternalSubtitle drops the bare-DeliveryUrl case
(an Hls-delivered sub has a DeliveryUrl but isn't sub-add-ed) so sorting,
loading and resolution agree; compareTracksForMenu now uses it.
- applyMpvSubtitleSelection wraps player calls in try/catch — fire-and-forget
call sites no longer risk unhandled rejections.
- VideoContext offline-transcoded branch: treat missing IsTextSubtitleStream as
text (use !isImageBasedSubtitle), matching the shared helper.
- ItemContent.tv refreshSubtitleTracks: apply compareTracksForMenu like the
initial list.
- Tests: use the @/ alias; rework the embedded cases to actually exercise
identity (reversed player order) and the ordinal fallback (same-language,
no title).
resolveSubtitleTrack matches a Jellyfin subtitle against the player's real
track list (external by external-filename, embedded by language/title) instead
of positional counting, which mis-selects when externals/embedded are reordered
or the server hides embedded subs. applyMpvSubtitleSelection is the shared entry
point (reusable for the cast backend). compareTracksForMenu mirrors web's
itemHelper.sortTracks. Drops dead getMpvSubtitleId/isSubtitleInMpv. 14 unit tests.