diff options
author | sinanmohd <sinan@sinanmohd.com> | 2023-12-04 18:48:41 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2023-12-04 19:04:30 +0530 |
commit | 421aeafa298f020f9a83e427d908b753fdb54a7d (patch) | |
tree | bde25c2f824cdf21f6a457d7d0c6a6533a84bf52 | |
parent | a30a250c87c0641ee1267107689fba3c6ca7fc8e (diff) |
mpv: check nil for duration property
for live streams mpv will return nil
-rw-r--r-- | main.lua | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -21,10 +21,10 @@ local sub_needed = function () return false end - duration = tonumber(mp.get_property('duration')) - if duration < 900 then -- duration is less than 15 minutes + duration = mp.get_property('duration') + if not duration or tonumber(duration) < 900 then return false - end + end -- ensure duration is less than 15 minutes for _, v in pairs(mp.get_property_native('track-list')) do if v['type'] == 'sub' then |