summaryrefslogtreecommitdiff
path: root/lua/file_browser.lua
diff options
context:
space:
mode:
authorSam <github@samlord.co.uk>2025-02-04 21:13:52 +0000
committerSam <github@samlord.co.uk>2025-02-04 21:13:52 +0000
commitff733e8f0c827e3d2d91bb7db29a85807867ab5e (patch)
treeede269bca54b5316e5e0cd13eedde82d938b26dc /lua/file_browser.lua
parent844b3f733ec30eff41c3b3d48c74561d7b11da8e (diff)
downloadtangara-fw-ff733e8f0c827e3d2d91bb7db29a85807867ab5e.tar.gz
Wrap filesystem iterator
Change to wrapping the filesystem iterator rather than iterating over table values. Also centralise the is_playlist check and hide Playlists menu if none are present
Diffstat (limited to 'lua/file_browser.lua')
-rw-r--r--lua/file_browser.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/lua/file_browser.lua b/lua/file_browser.lua
index 98261d55..6289828f 100644
--- a/lua/file_browser.lua
+++ b/lua/file_browser.lua
@@ -8,11 +8,11 @@ local backstack = require("backstack")
local font = require("font")
local queue = require("queue")
local playing = require("playing")
-local styles = require("styles")
local playback = require("playback")
local theme = require("theme")
local screen = require("screen")
local filesystem = require("filesystem")
+local playlist_iterator = require("playlist_iterator")
return screen:new {
create_ui = function(self)
@@ -70,8 +70,7 @@ return screen:new {
breadcrumb = item:filepath()
})
elseif
- item:filepath():match("%.playlist$") or
- item:filepath():match("%.m3u8?$") then
+ playlist_iterator:is_playlist(item) then
queue.open_playlist(item:filepath())
playback.playing:set(true)
backstack.push(playing:new())