Skip to content

Commit

Permalink
Try to use existing title property for playlist items
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklaen committed Jun 27, 2022
1 parent ee84bf7 commit 945594b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion uosc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3305,8 +3305,9 @@ mp.add_key_binding(nil, 'playlist', function()
local active_item
for index, item in ipairs(mp.get_property_native('playlist')) do
local is_url = item.filename:find('://')
local item_title = type(item.title) == 'string' and #item.title > 0 and item.title or false
items[index] = {
title = is_url and item.filename or serialize_path(item.filename).basename,
title = item_title or (is_url and item.filename or serialize_path(item.filename).basename),
hint = tostring(index),
value = index
}
Expand Down

0 comments on commit 945594b

Please # to comment.