Skip to content

Commit

Permalink
observers.lua: add type annotations for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
CogentRedTester committed Feb 3, 2025
1 parent 4c3f697 commit 2a22f60
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/observers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,29 @@ local fb_utils = require 'modules.utils'

local observers ={}

--saves the directory and name of the currently playing file
---saves the directory and name of the currently playing file
---@param _ string
---@param filepath string
function observers.current_directory(_, filepath)
directory_movement.set_current_file(filepath)
end

---@param _ string
---@param device string
function observers.dvd_device(_, device)
if not device or device == "" then device = '/dev/dvd' end
fb.register_directory_mapping(fb_utils.absolute_path(device), '^dvd://.*', true)
end

---@param _ string
---@param device string
function observers.bd_device(_, device)
if not device or device == '' then device = '/dev/bd' end
fb.register_directory_mapping(fb_utils.absolute_path(device), '^bd://.*', true)
end

---@param _ string
---@param device string
function observers.cd_device(_, device)
if not device or device == '' then device = '/dev/cdrom' end
fb.register_directory_mapping(fb_utils.absolute_path(device), '^cdda://.*', true)
Expand Down

0 comments on commit 2a22f60

Please sign in to comment.