feat: add cbr and cbz as valid archive extensions (#2077)

Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
AminurAlam 2024-12-23 07:04:46 +00:00 committed by GitHub
parent 5bd71bf225
commit d746ae8338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,7 +111,7 @@ function M.tmp_name(url) return ".tmp_" .. ya.hash(string.format("extract//%s//%
function M.trim_ext(name)
-- stylua: ignore
local exts = { ["7z"] = true, apk = true, bz2 = true, bzip2 = true, exe = true, gz = true, gzip = true, iso = true, jar = true, rar = true, tar = true, tgz = true, xz = true, zip = true, zst = true }
local exts = { ["7z"] = true, apk = true, bz2 = true, bzip2 = true, cbr = true, cbz = true, exe = true, gz = true, gzip = true, iso = true, jar = true, rar = true, tar = true, tgz = true, xz = true, zip = true, zst = true }
while true do
local s = name:gsub("%.([a-zA-Z0-9]+)$", function(s) return (exts[s] or exts[s:lower()]) and "" end)