diff --git a/scripts/uosc/lib/utils.lua b/scripts/uosc/lib/utils.lua index 97f8bbd..7eedbc0 100644 --- a/scripts/uosc/lib/utils.lua +++ b/scripts/uosc/lib/utils.lua @@ -319,7 +319,7 @@ end -- Check if path is a protocol, such as `http://...`. ---@param path string function is_protocol(path) - return type(path) == 'string' and (path:find('^%a[%a%d-_]+://') ~= nil or path:find('^%a[%a%d-_]+:%?') ~= nil) + return type(path) == 'string' and (path:find('^%a[%w.+-]-://') ~= nil or path:find('^%a[%w.+-]-:%?') ~= nil) end ---@param path string diff --git a/scripts/uosc/main.lua b/scripts/uosc/main.lua index 0394e35..2819b1e 100644 --- a/scripts/uosc/main.lua +++ b/scripts/uosc/main.lua @@ -969,7 +969,7 @@ bind_command('playlist', create_self_updating_menu_opener({ serializer = function(playlist) local items = {} for index, item in ipairs(playlist) do - local is_url = item.filename:find('://') + local is_url = is_protocol(item.filename) local item_title = type(item.title) == 'string' and #item.title > 0 and item.title or false items[index] = { title = item_title or (is_url and item.filename or serialize_path(item.filename).basename),