Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion player/lua/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ end

local function format_track(track)
local bitrate = track["demux-bitrate"] or track["hls-bitrate"]
local bidi_fsi = "\226\129\168" -- U+2068 FIRST STRONG ISOLATE
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put these someplace more global. There could be other places at the OSC which would want to use it.

Also, the casual code reader probably doesn't know what "FIRST STRONG ISOLATE" means, so a comment could help (but "POP DIRECTIONAL ISOLATE" does sound self-describing)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put these someplace more global. There could be other places at the OSC which would want to use it.

then it can be moved to common place based on required uses.

Also, the casual code reader probably doesn't know what "FIRST STRONG ISOLATE" means

The causal code reader can use google or chatgpt to educate themselves.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the casual code reader probably doesn't know what "FIRST STRONG ISOLATE" means

Can add a comment pointing to the fine manual spec at https://www.unicode.org/reports/tr9/#Explicit_Directional_Isolates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the OSC dude

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it can be moved to common place based on required uses.

Technically, to avoid such random issues in the future, all arbitrary metadata strings should use it. Not just this specific display.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, to avoid such random issues in the future, all arbitrary metadata strings should use it. Not just this specific display.

Yes, and once this change is created the correct design can be applied to handling this escaping.

local bidi_pdi = "\226\129\169" -- U+2069 POP DIRECTIONAL ISOLATE

return (track.selected and "●" or "○") ..
(track.title and " " .. track.title or "") ..
(track.title and " " .. bidi_fsi .. track.title .. bidi_pdi or "") ..
" (" .. (
(track.lang and track.lang .. " " or "") ..
(track.codec and track.codec .. " " or "") ..
Expand Down
Loading