lua: Format with stylua

This commit is contained in:
Marty Oehme 2023-06-15 10:12:30 +02:00
parent e434c191c9
commit 5f93ecba7c
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
33 changed files with 4062 additions and 3413 deletions

View file

@ -7,27 +7,27 @@
-- e.g.
-- `mpv gallery-dl://https://imgur.com/....`
local mp = require 'mp'
local utils = require 'mp.utils'
local msg = require 'mp.msg'
local mp = require("mp")
local utils = require("mp.utils")
local msg = require("mp.msg")
local function exec(args)
local ret = utils.subprocess({ args = args })
return ret.status, ret.stdout, ret
local ret = utils.subprocess({ args = args })
return ret.status, ret.stdout, ret
end
mp.add_hook("on_load", 15, function()
local fn = mp.get_property("stream-open-filename", "")
if (fn:find("gdl://") ~= 1) then
msg.debug("not a gdl:// url: " .. fn)
return
end
local url = string.gsub(url, "gdl://", "")
local fn = mp.get_property("stream-open-filename", "")
if fn:find("gdl://") ~= 1 then
msg.debug("not a gdl:// url: " .. fn)
return
end
local url = string.gsub(url, "gdl://", "")
local es, urls, result = exec({ "gallery-dl", "-g", url })
if (es < 0) or (urls == nil) or (urls == "") then
msg.error("failed to get album list.")
end
local es, urls, result = exec({ "gallery-dl", "-g", url })
if (es < 0) or (urls == nil) or (urls == "") then
msg.error("failed to get album list.")
end
mp.commandv("loadlist", "memory://" .. urls)
mp.commandv("loadlist", "memory://" .. urls)
end)