Skip to content

Commit

Permalink
Merge pull request #124 from CogentRedTester/API/v1.7.1
Browse files Browse the repository at this point in the history
Bump Addon API to v1.7.1
  • Loading branch information
CogentRedTester authored Feb 22, 2025
2 parents a27b266 + b137e4b commit 657e8eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/addons.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to Write an Addon - API v1.7.0
# How to Write an Addon - API v1.7.1

Addons provide ways for file-browser to parse non-native directory structures. This document describes how one can create their own custom addon.

Expand Down Expand Up @@ -859,8 +859,9 @@ Used for custom-keybind filtering.

The current directory open in the browser.

#### `fb.get_dvd_device(): string`
#### ~~`fb.get_dvd_device(): string`~~

*DEPRECATED*.
The current dvd-device as reported by mpv's `dvd-device` property.
Formatted to work with file-browser.

Expand Down
9 changes: 8 additions & 1 deletion modules/apis/fb.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
local mp = require 'mp'
local msg = require 'mp.msg'
local utils = require 'mp.utils'

Expand Down Expand Up @@ -106,7 +107,6 @@ function fb.get_sub_extensions() return fb.copy_table(g.sub_extensions) end
function fb.get_audio_extensions() return fb.copy_table(g.audio_extensions) end
function fb.get_parseable_extensions() return fb.copy_table(g.parseable_extensions) end
function fb.get_state() return fb.copy_table(g.state) end
function fb.get_dvd_device() return g.dvd_device end
function fb.get_parsers() return fb.copy_table(g.parsers) end
function fb.get_root() return fb.copy_table(g.root) end
function fb.get_directory() return g.state.directory end
Expand All @@ -119,6 +119,13 @@ function fb.get_selected_item() return fb.copy_table(g.state.list[g.state.select
function fb.get_open_status() return not g.state.hidden end
function fb.get_parse_state(co) return g.parse_states[co or coroutine.running() or ""] end

-- deprecated
function fb.get_dvd_device()
local dvd_device = mp.get_property('dvd-device')
if not dvd_device then return nil end
return fb_utils.fix_path(dvd_device, true)
end

function fb.set_empty_text(str)
g.state.empty_text = str
fb.redraw()
Expand Down
2 changes: 1 addition & 1 deletion modules/globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local globals = {}
local o = require 'modules.options'

--sets the version for the file-browser API
globals.API_VERSION = "1.7.0"
globals.API_VERSION = "1.7.1"

--gets the current platform (only works in mpv v0.36+)
globals.PLATFORM = mp.get_property_native('platform')
Expand Down

0 comments on commit 657e8eb

Please sign in to comment.