mirror of
https://github.com/iptv-org/database.git
synced 2025-05-09 19:20:01 -04:00
Update scripts
This commit is contained in:
parent
adc7c71c0d
commit
43ed983480
4 changed files with 3 additions and 48 deletions
|
@ -116,10 +116,7 @@ async function editFeeds() {
|
||||||
broadcast_area: data.getArray('broadcast_area'),
|
broadcast_area: data.getArray('broadcast_area'),
|
||||||
timezones: data.getArray('timezones'),
|
timezones: data.getArray('timezones'),
|
||||||
languages: data.getArray('languages'),
|
languages: data.getArray('languages'),
|
||||||
video_format: data.getString('video_format'),
|
video_format: data.getString('video_format')
|
||||||
launched: data.getString('launched'),
|
|
||||||
closed: data.getString('closed'),
|
|
||||||
replaced_by: data.getString('replaced_by')
|
|
||||||
})
|
})
|
||||||
|
|
||||||
found.merge(updated)
|
found.merge(updated)
|
||||||
|
@ -169,10 +166,7 @@ async function addFeeds() {
|
||||||
broadcast_area: data.getArray('broadcast_area'),
|
broadcast_area: data.getArray('broadcast_area'),
|
||||||
timezones: data.getArray('timezones'),
|
timezones: data.getArray('timezones'),
|
||||||
languages: data.getArray('languages'),
|
languages: data.getArray('languages'),
|
||||||
video_format: data.getString('video_format'),
|
video_format: data.getString('video_format')
|
||||||
launched: data.getString('launched'),
|
|
||||||
closed: data.getString('closed'),
|
|
||||||
replaced_by: data.getString('replaced_by')
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -381,12 +375,6 @@ function onFeedIdChange(channelId: string, feedId: string, newFeedId: string) {
|
||||||
channel.replaced_by = `${channelId}@${newFeedId}`
|
channel.replaced_by = `${channelId}@${newFeedId}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
feeds.forEach((feed: Feed) => {
|
|
||||||
if (feed.replaced_by && feed.replaced_by === `${channelId}@${feedId}`) {
|
|
||||||
feed.replaced_by = `${channelId}@${newFeedId}`
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFeedNewMain(channelId: string, feedId: string) {
|
function onFeedNewMain(channelId: string, feedId: string) {
|
||||||
|
@ -403,12 +391,6 @@ function onFeedRemoval(channelId: string, feedId: string) {
|
||||||
channel.replaced_by = ''
|
channel.replaced_by = ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
feeds.forEach((feed: Feed) => {
|
|
||||||
if (feed.replaced_by && feed.replaced_by === `${channelId}@${feedId}`) {
|
|
||||||
feed.replaced_by = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onChannelIdChange(channelId: string, newChannelId: string) {
|
function onChannelIdChange(channelId: string, newChannelId: string) {
|
||||||
|
@ -422,10 +404,6 @@ function onChannelIdChange(channelId: string, newChannelId: string) {
|
||||||
if (feed.channel === channelId) {
|
if (feed.channel === channelId) {
|
||||||
feed.channel = newChannelId
|
feed.channel = newChannelId
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feed.replaced_by && feed.replaced_by.includes(channelId)) {
|
|
||||||
feed.replaced_by = feed.replaced_by.replace(channelId, newChannelId)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
blocklist.forEach((blocked: Blocked) => {
|
blocklist.forEach((blocked: Blocked) => {
|
||||||
|
@ -443,9 +421,4 @@ function onChannelRemoval(channelId: string) {
|
||||||
})
|
})
|
||||||
|
|
||||||
feeds.remove((feed: Feed) => feed.channel === channelId)
|
feeds.remove((feed: Feed) => feed.channel === channelId)
|
||||||
feeds.forEach((feed: Feed) => {
|
|
||||||
if (feed.replaced_by && feed.replaced_by.includes(channelId)) {
|
|
||||||
feed.replaced_by = ''
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,6 @@ async function main() {
|
||||||
for (const [i, row] of rowsCopy.entries()) {
|
for (const [i, row] of rowsCopy.entries()) {
|
||||||
fileErrors = fileErrors.concat(validateChannel(row.channel, i))
|
fileErrors = fileErrors.concat(validateChannel(row.channel, i))
|
||||||
fileErrors = fileErrors.concat(validateTimezones(row, i))
|
fileErrors = fileErrors.concat(validateTimezones(row, i))
|
||||||
fileErrors = fileErrors.concat(validateReplacedBy(row, i))
|
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case 'blocklist':
|
case 'blocklist':
|
||||||
|
|
|
@ -7,9 +7,6 @@ type FeedProps = {
|
||||||
timezones?: string[]
|
timezones?: string[]
|
||||||
languages?: string[]
|
languages?: string[]
|
||||||
video_format?: string
|
video_format?: string
|
||||||
launched?: string
|
|
||||||
closed?: string
|
|
||||||
replaced_by?: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Feed {
|
export class Feed {
|
||||||
|
@ -21,9 +18,6 @@ export class Feed {
|
||||||
timezones: string[]
|
timezones: string[]
|
||||||
languages: string[]
|
languages: string[]
|
||||||
video_format?: string
|
video_format?: string
|
||||||
launched?: string
|
|
||||||
closed?: string
|
|
||||||
replaced_by?: string
|
|
||||||
|
|
||||||
constructor({
|
constructor({
|
||||||
channel,
|
channel,
|
||||||
|
@ -33,10 +27,7 @@ export class Feed {
|
||||||
broadcast_area,
|
broadcast_area,
|
||||||
timezones,
|
timezones,
|
||||||
languages,
|
languages,
|
||||||
video_format,
|
video_format
|
||||||
launched,
|
|
||||||
closed,
|
|
||||||
replaced_by
|
|
||||||
}: FeedProps) {
|
}: FeedProps) {
|
||||||
this.channel = channel
|
this.channel = channel
|
||||||
this.id = id
|
this.id = id
|
||||||
|
@ -46,9 +37,6 @@ export class Feed {
|
||||||
this.timezones = timezones || []
|
this.timezones = timezones || []
|
||||||
this.languages = languages || []
|
this.languages = languages || []
|
||||||
this.video_format = video_format
|
this.video_format = video_format
|
||||||
this.launched = launched
|
|
||||||
this.closed = closed
|
|
||||||
this.replaced_by = replaced_by
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -32,10 +32,5 @@ export default {
|
||||||
),
|
),
|
||||||
video_format: Joi.string()
|
video_format: Joi.string()
|
||||||
.regex(/^\d+(i|p)$/)
|
.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)
|
.allow(null)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue