mirror of
https://github.com/iptv-org/database.git
synced 2024-11-09 22:16:38 -05:00
Update channels.js
This commit is contained in:
parent
4c9f78ad09
commit
13d6dd97e3
1 changed files with 9 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
const Joi = require('joi')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
id: Joi.string()
|
||||
|
@ -41,5 +42,13 @@ module.exports = {
|
|||
.uri({
|
||||
scheme: ['https']
|
||||
})
|
||||
.custom((value, helper) => {
|
||||
const ext = path.extname(value)
|
||||
if (!ext || /(\.png|\.jpeg|\.jpg)/i.test(ext)) {
|
||||
return true
|
||||
} else {
|
||||
return helper.message(`"logo" has an invalid file extension "${ext}"`)
|
||||
}
|
||||
})
|
||||
.allow(null)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue