Skip to content

Commit 7e0efb1

Browse files
committed
FIX: fix modernx.lua crashing if playing a live radio (m3u8 file)
1 parent 09968ee commit 7e0efb1

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Please note that many of these scripts have been slightly modified from their in
3232

3333
## Updates
3434

35+
### 2025-01-10
36+
37+
- FIX: fix modernx.lua crashing if playing a live radio (m3u8 file)
38+
3539
### 2025-01-09
3640

3741
- Re-add `key_bindings` in `modernx.lua`

scripts/modernx.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,10 +1833,14 @@ function exec_description(args, result)
18331833
if afterLastPattern then
18341834
if (select(2, afterLastPattern:gsub("\\N", "")) == 1) then -- get rid of last | if there's only one item
18351835
-- print("Erasing last item")
1836-
tempDesc = tempDesc:gsub(" | ", "")
1837-
state.videoDescription = tempDesc .. " | " ..
1838-
mp.get_property("width") .. "x" .. mp.get_property("height") .. " | FPS: " ..
1839-
math.floor(mp.get_property_number("estimated-vf-fps") + 0.5) -- can't get a normal description, display something else
1836+
if mp.get_property_number("estimated-vf-fps") then
1837+
tempDesc = tempDesc:gsub(" | ", "")
1838+
state.videoDescription = tempDesc .. " | " ..
1839+
mp.get_property("width") .. "x" .. mp.get_property("height") .. " | FPS: " ..
1840+
math.floor(mp.get_property_number("estimated-vf-fps") + 0.5) or "" -- can't get a normal description, display something else
1841+
else
1842+
state.videoDescription = "No description"
1843+
end
18401844
end
18411845
end
18421846

0 commit comments

Comments
 (0)