add id3 filetype (#42)

* add id3 filetype

* remove unused properties from file types
This commit is contained in:
Pierce Lally 2023-09-16 13:37:25 -04:00 committed by GitHub
parent fdcf19a1a3
commit 18b9e2f35f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 26 deletions

View File

@ -1,7 +1,6 @@
local HTML = {
name = "HTML",
extension = "html",
maxFileSize = 0,
}
CFCHTTP.FileTypes.HTML = HTML
@ -12,13 +11,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,22 @@
CFCHTTP.FileTypes.ID3 = {
name = "ID3",
}
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

@ -1,8 +1,6 @@
CFCHTTP.FileTypes.M3U = {
name = "M3U",
allowed = false,
extension = "m3u",
maxFileSize = 0,
}
local M3U = CFCHTTP.FileTypes.M3U
@ -15,13 +13,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

@ -1,8 +1,6 @@
CFCHTTP.FileTypes.PLS = {
name = "PLS",
allowed = false,
extension = ".pls",
maxFileSize = 10000,
}
local PLS = CFCHTTP.FileTypes.PLS
@ -13,13 +11,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