From 3421bd652c39b253872e43d3b6e43664bd0b66e2 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 28 Aug 2024 15:30:53 +1000 Subject: When clicking a track in the file browser, play it Includes adding a `playback.is_playable` for working out whether or not a particular file is able to be played --- lua/file_browser.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lua/file_browser.lua') diff --git a/lua/file_browser.lua b/lua/file_browser.lua index f4f6f216..08d683e1 100644 --- a/lua/file_browser.lua +++ b/lua/file_browser.lua @@ -65,11 +65,15 @@ return screen:new { iterator = filesystem.iterator(item:filepath()), breadcrumb = item:filepath() }) - end - if item:filepath():match("%.playlist$") then + elseif item:filepath():match("%.playlist$") then queue.open_playlist(item:filepath()) playback.playing:set(true) backstack.push(playing:new()) + elseif playback.is_playable(item:filepath()) then + queue.clear() + queue.add(item:filepath()) + playback.playing:set(true) + backstack.push(playing:new()) end end end -- cgit v1.2.3