mirror of
https://github.com/iptv-org/database.git
synced 2024-11-21 18:42:31 -05:00
Update channels.js
This commit is contained in:
parent
a4a8c0b688
commit
00659e98d5
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
const Joi = require('joi').extend(require('@joi/date'))
|
const Joi = require('joi').extend(require('@joi/date'))
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const url = require('url')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
id: Joi.string()
|
id: Joi.string()
|
||||||
|
@ -53,7 +54,7 @@ module.exports = {
|
||||||
scheme: ['https']
|
scheme: ['https']
|
||||||
})
|
})
|
||||||
.custom((value, helper) => {
|
.custom((value, helper) => {
|
||||||
const ext = path.extname(path.basename(value))
|
const ext = path.extname(url.parse(value).pathname)
|
||||||
if (!ext || /(\.png|\.jpeg|\.jpg)/i.test(ext)) {
|
if (!ext || /(\.png|\.jpeg|\.jpg)/i.test(ext)) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue