mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
wip
This commit is contained in:
parent
d068f5083f
commit
557a05ddac
13 changed files with 3046 additions and 142057 deletions
|
@ -46,12 +46,12 @@ async function loadChannels() {
|
|||
async function saveToDatabase() {
|
||||
logger.info('Saving to the database...')
|
||||
|
||||
await db.reset()
|
||||
await db.channels.reset()
|
||||
const chunks = split(_.shuffle(channels), options.maxClusters)
|
||||
for (const [i, chunk] of chunks.entries()) {
|
||||
for (const item of chunk) {
|
||||
item.cluster_id = i + 1
|
||||
await db.insert(item)
|
||||
await db.channels.insert(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue