diff options
Diffstat (limited to 'mpv/scripts/file-browser/modules/addons/root.lua')
| -rw-r--r-- | mpv/scripts/file-browser/modules/addons/root.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mpv/scripts/file-browser/modules/addons/root.lua b/mpv/scripts/file-browser/modules/addons/root.lua new file mode 100644 index 0000000..412a5ba --- /dev/null +++ b/mpv/scripts/file-browser/modules/addons/root.lua @@ -0,0 +1,26 @@ +-- This file is an internal file-browser addon. +-- It should not be imported like a normal module. + +local g = require 'modules.globals' + +---Parser for the root. +---@type ParserConfig +local root_parser = { + name = "root", + priority = math.huge, + api_version = '1.0.0', +} + +function root_parser:can_parse(directory) + return directory == '' +end + +--we return the root directory exactly as setup +function root_parser:parse() + return g.root, { + sorted = true, + filtered = true, + } +end + +return root_parser |
