mirror of
https://github.com/iptv-org/database.git
synced 2024-11-22 02:44:10 -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 Joi = require('joi')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
id: Joi.string()
|
id: Joi.string()
|
||||||
|
@ -41,5 +42,13 @@ module.exports = {
|
||||||
.uri({
|
.uri({
|
||||||
scheme: ['https']
|
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)
|
.allow(null)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue