summaryrefslogtreecommitdiff
path: root/lua/file_browser.lua
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-08-28 15:30:53 +1000
committerjacqueline <me@jacqueline.id.au>2024-08-28 15:30:53 +1000
commit3421bd652c39b253872e43d3b6e43664bd0b66e2 (patch)
tree90a6cc3980e32648b8488db281dc838e3ffbdd7d /lua/file_browser.lua
parentaf7a70450e3ceaaf291aa09b9383b50b879759d9 (diff)
downloadtangara-fw-3421bd652c39b253872e43d3b6e43664bd0b66e2.tar.gz
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
Diffstat (limited to 'lua/file_browser.lua')
-rw-r--r--lua/file_browser.lua8
1 files changed, 6 insertions, 2 deletions
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