diff --git a/scripts/db/update.ts b/scripts/db/update.ts index 4f632348..ca98cc47 100644 --- a/scripts/db/update.ts +++ b/scripts/db/update.ts @@ -116,10 +116,7 @@ async function editFeeds() { broadcast_area: data.getArray('broadcast_area'), timezones: data.getArray('timezones'), languages: data.getArray('languages'), - video_format: data.getString('video_format'), - launched: data.getString('launched'), - closed: data.getString('closed'), - replaced_by: data.getString('replaced_by') + video_format: data.getString('video_format') }) found.merge(updated) @@ -169,10 +166,7 @@ async function addFeeds() { broadcast_area: data.getArray('broadcast_area'), timezones: data.getArray('timezones'), languages: data.getArray('languages'), - video_format: data.getString('video_format'), - launched: data.getString('launched'), - closed: data.getString('closed'), - replaced_by: data.getString('replaced_by') + video_format: data.getString('video_format') }) ) @@ -381,12 +375,6 @@ function onFeedIdChange(channelId: string, feedId: string, newFeedId: string) { 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) { @@ -403,12 +391,6 @@ function onFeedRemoval(channelId: string, feedId: string) { 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) { @@ -422,10 +404,6 @@ function onChannelIdChange(channelId: string, newChannelId: string) { if (feed.channel === channelId) { 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) => { @@ -443,9 +421,4 @@ function onChannelRemoval(channelId: string) { }) feeds.remove((feed: Feed) => feed.channel === channelId) - feeds.forEach((feed: Feed) => { - if (feed.replaced_by && feed.replaced_by.includes(channelId)) { - feed.replaced_by = '' - } - }) } diff --git a/scripts/db/validate.ts b/scripts/db/validate.ts index c42fdf0c..27f59577 100644 --- a/scripts/db/validate.ts +++ b/scripts/db/validate.ts @@ -115,7 +115,6 @@ async function main() { for (const [i, row] of rowsCopy.entries()) { fileErrors = fileErrors.concat(validateChannel(row.channel, i)) fileErrors = fileErrors.concat(validateTimezones(row, i)) - fileErrors = fileErrors.concat(validateReplacedBy(row, i)) } break case 'blocklist': diff --git a/scripts/models/feed.ts b/scripts/models/feed.ts index 1f524c8a..55db1f76 100644 --- a/scripts/models/feed.ts +++ b/scripts/models/feed.ts @@ -7,9 +7,6 @@ type FeedProps = { timezones?: string[] languages?: string[] video_format?: string - launched?: string - closed?: string - replaced_by?: string } export class Feed { @@ -21,9 +18,6 @@ export class Feed { timezones: string[] languages: string[] video_format?: string - launched?: string - closed?: string - replaced_by?: string constructor({ channel, @@ -33,10 +27,7 @@ export class Feed { broadcast_area, timezones, languages, - video_format, - launched, - closed, - replaced_by + video_format }: FeedProps) { this.channel = channel this.id = id @@ -46,9 +37,6 @@ export class Feed { this.timezones = timezones || [] this.languages = languages || [] this.video_format = video_format - this.launched = launched - this.closed = closed - this.replaced_by = replaced_by } data() { diff --git a/scripts/schemes/feeds.ts b/scripts/schemes/feeds.ts index c1cc340f..605580eb 100644 --- a/scripts/schemes/feeds.ts +++ b/scripts/schemes/feeds.ts @@ -32,10 +32,5 @@ export default { ), 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) }