fix: v4 changes in the preset mime plugin, closes #33

This commit is contained in:
sxyazi
2024-11-20 23:22:26 +08:00
parent 4a6edc3349
commit ab7068ef75
2 changed files with 4 additions and 3 deletions

View File

@@ -1053,6 +1053,7 @@ end
function M:fetch(args)
-- TODO: remove this once Yazi 0.4 is released
local not_v4 = not args
args = args or self
local opts = options()
@@ -1083,7 +1084,7 @@ function M:fetch(args)
if #unknown > 0 then
args.files = unknown
return require("mime").fetch(args)
return not_v4 and require("mime").fetch(args) or require("mime"):fetch(args)
end
return 1