mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-07 04:53:01 +01:00
chore(subtitles): address review nitpicks
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).
This commit is contained in:
@@ -539,7 +539,9 @@ class MPVLayerRenderer(private val context: Context) : MPVLib.EventObserver {
|
||||
|
||||
// Identity fields used to map a Jellyfin subtitle to the real track
|
||||
// (instead of fragile positional counting). `external` + `external-filename`
|
||||
// uniquely identify a sub-added sidecar; `ff-index` aids embedded matching.
|
||||
// uniquely identify a sub-added sidecar. `ff-index` is exposed for
|
||||
// diagnostics / potential future exact-index matching; the current
|
||||
// resolver matches embedded tracks by language/title, not ff-index.
|
||||
val external = mpv?.getPropertyBoolean("track-list/$i/external") ?: false
|
||||
track["external"] = external
|
||||
mpv?.getPropertyString("track-list/$i/external-filename")?.let {
|
||||
|
||||
@@ -786,7 +786,9 @@ final class MPVLayerRenderer {
|
||||
|
||||
// Identity fields used to map a Jellyfin subtitle to the real track
|
||||
// (instead of fragile positional counting). `external` + `external-filename`
|
||||
// uniquely identify a sub-added sidecar; `ff-index` aids embedded matching.
|
||||
// uniquely identify a sub-added sidecar. `ff-index` is exposed for
|
||||
// diagnostics / potential future exact-index matching; the current
|
||||
// resolver matches embedded tracks by language/title, not ff-index.
|
||||
var external: Int32 = 0
|
||||
getProperty(handle: handle, name: "track-list/\(i)/external", format: MPV_FORMAT_FLAG, value: &external)
|
||||
track["external"] = external != 0
|
||||
|
||||
@@ -91,7 +91,9 @@ export const compareTracksForMenu = (a: MediaStream, b: MediaStream): number =>
|
||||
Number(a.IsExternal ?? false) - Number(b.IsExternal ?? false) ||
|
||||
Number(b.IsForced ?? false) - Number(a.IsForced ?? false) ||
|
||||
Number(b.IsDefault ?? false) - Number(a.IsDefault ?? false) ||
|
||||
(a.Index ?? 0) - (b.Index ?? 0);
|
||||
// Missing Index sorts to the end (not 0, which would float it to the top and
|
||||
// collide with a real Index 0).
|
||||
(a.Index ?? Number.MAX_SAFE_INTEGER) - (b.Index ?? Number.MAX_SAFE_INTEGER);
|
||||
|
||||
/**
|
||||
* Identity of a subtitle track as reported by the *player's real track list*
|
||||
|
||||
Reference in New Issue
Block a user