refactor: remove compatibility code for Yazi 0.3

This commit is contained in:
sxyazi
2024-12-23 15:29:59 +08:00
parent f1317106ab
commit c7feb90930
5 changed files with 7 additions and 43 deletions

View File

@@ -1060,10 +1060,6 @@ function M:setup(opts)
end
function M:fetch(job)
-- TODO: remove this once Yazi 0.4 is released
local not_v4 = not job
job = job or self
local opts = options()
local merged_files = ya.dict_merge(FILES, opts.with_files or {})
local merged_exts = ya.dict_merge(EXTS, opts.with_exts or {})
@@ -1089,12 +1085,11 @@ function M:fetch(job)
if next(updates) then
ya.manager_emit("update_mimes", { updates = updates })
ya.manager_emit("update_mimetype", { updates = updates }) -- TODO: remove this
end
if #unknown > 0 then
job.files = unknown
return not_v4 and require("mime").fetch(job) or require("mime"):fetch(job)
return require("mime"):fetch(job)
end
return 1