mirror of
https://github.com/iptv-org/database.git
synced 2025-05-10 03:30:01 -04:00
Update scripts
This commit is contained in:
parent
77680e2dc9
commit
075c53143e
14 changed files with 520 additions and 132 deletions
|
@ -46,7 +46,7 @@ export default {
|
|||
launched: Joi.date().format('YYYY-MM-DD').raw().allow(null),
|
||||
closed: Joi.date().format('YYYY-MM-DD').raw().allow(null).greater(Joi.ref('launched')),
|
||||
replaced_by: Joi.string()
|
||||
.regex(/^[A-Za-z0-9]+\.[a-z]{2}$/)
|
||||
.regex(/^[A-Za-z0-9]+\.[a-z]{2}($|@[A-Za-z0-9]+$)/)
|
||||
.allow(null),
|
||||
website: Joi.string()
|
||||
.regex(/,/, { invert: true })
|
||||
|
|
41
scripts/schemes/feeds.ts
Normal file
41
scripts/schemes/feeds.ts
Normal file
|
@ -0,0 +1,41 @@
|
|||
import BaseJoi from 'joi'
|
||||
import JoiDate from '@joi/date'
|
||||
|
||||
const Joi = BaseJoi.extend(JoiDate)
|
||||
|
||||
export default {
|
||||
channel: Joi.string()
|
||||
.regex(/^[A-Za-z0-9]+\.[a-z]{2}$/)
|
||||
.required(),
|
||||
id: Joi.string()
|
||||
.regex(/^[A-Za-z0-9]+$/)
|
||||
.required(),
|
||||
name: Joi.string()
|
||||
.regex(/^[a-z0-9-!:&.+'/»#%°$@?|¡–\s_—]+$/i)
|
||||
.regex(/^((?!\s-\s).)*$/)
|
||||
.required(),
|
||||
is_main: Joi.boolean().strict().required(),
|
||||
broadcast_area: Joi.array().items(
|
||||
Joi.string()
|
||||
.regex(/^(s\/[A-Z]{2}-[A-Z0-9]{1,3}|c\/[A-Z]{2}|r\/[A-Z0-9]{2,7})$/)
|
||||
.required()
|
||||
),
|
||||
timezones: Joi.array().items(
|
||||
Joi.string()
|
||||
.regex(/^[a-z-_/]+$/i)
|
||||
.required()
|
||||
),
|
||||
languages: Joi.array().items(
|
||||
Joi.string()
|
||||
.regex(/^[a-z]{3}$/)
|
||||
.required()
|
||||
),
|
||||
video_format: Joi.string()
|
||||
.regex(/^\d+(i|p)$/)
|
||||
.allow(null),
|
||||
launched: Joi.date().format('YYYY-MM-DD').raw().allow(null),
|
||||
closed: Joi.date().format('YYYY-MM-DD').raw().allow(null).greater(Joi.ref('launched')),
|
||||
replaced_by: Joi.string()
|
||||
.regex(/^[A-Za-z0-9]+\.[a-z]{2}($|@[A-Za-z0-9]+$)/)
|
||||
.allow(null)
|
||||
}
|
|
@ -5,6 +5,8 @@ import { default as languages } from './languages'
|
|||
import { default as regions } from './regions'
|
||||
import { default as subdivisions } from './subdivisions'
|
||||
import { default as blocklist } from './blocklist'
|
||||
import { default as feeds } from './feeds'
|
||||
import { default as timezones } from './timezones'
|
||||
|
||||
export default {
|
||||
channels,
|
||||
|
@ -13,5 +15,7 @@ export default {
|
|||
languages,
|
||||
regions,
|
||||
subdivisions,
|
||||
blocklist
|
||||
blocklist,
|
||||
feeds,
|
||||
timezones
|
||||
}
|
||||
|
|
11
scripts/schemes/timezones.ts
Normal file
11
scripts/schemes/timezones.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
import Joi from 'joi'
|
||||
|
||||
export default {
|
||||
id: Joi.string()
|
||||
.regex(/^[a-z-_/]+$/i)
|
||||
.required(),
|
||||
utc_offset: Joi.string()
|
||||
.regex(/^(\+|-)\d{2}:\d{2}$/)
|
||||
.required(),
|
||||
countries: Joi.array().items(Joi.string().regex(/^[A-Z]{2}$/))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue