add id3 filetype

This commit is contained in:
Pierce 2023-09-16 00:44:19 -04:00
parent ceda1ebc83
commit 907c615594
No known key found for this signature in database
GPG Key ID: EC79465B0E865E47
4 changed files with 24 additions and 21 deletions

View File

@ -12,13 +12,6 @@ function HTML.IsFileData( _body )
return false
end
---@param url string
---@return boolean
function HTML.IsFileURL( url )
if string.EndsWith( url, "." .. HTML.extension ) then return true end
return false
end
---@param body string
---@return string[] urls
---@return string|nil error

View File

@ -0,0 +1,24 @@
CFCHTTP.FileTypes.ID3 = {
name = "ID3",
allowed = true,
maxFileSize = 0,
}
local ID3 = CFCHTTP.FileTypes.ID3
---@param body string
---@return boolean
function ID3.IsFileData( body )
if not string.StartsWith( body, "ID3" ) then return false end
return true
end
---@param _ string
---@return string[] urls
---@return string|nil error
function ID3.GetURLSFromData( _ )
-- we want to ignore urls in ID3 container metadata
return {}, nil
end
return ID3

View File

@ -15,13 +15,6 @@ function M3U.IsFileData( body )
return false
end
---@param url string
---@return boolean
function M3U.IsFileURL( url )
if string.EndsWith( url, "." .. M3U.extension ) then return true end
return false
end
---@param _ string
---@return string[] urls
---@return string|nil error

View File

@ -13,13 +13,6 @@ function PLS.IsFileData( body )
return false
end
---@param url string
---@return boolean
function PLS.IsFileURL( url )
if string.EndsWith( url, "." .. PLS.extension ) then return true end
return false
end
---@param _body string
---@return string[] urls
---@return string|nil error