@@ -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
|
||||
|
@@ -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),
|
||||
|
Reference in New Issue
Block a user