mirror of
https://github.com/iptv-org/iptv
synced 2026-10-26 12:58:23 -04:00
Update db.js
This commit is contained in:
1 parent
291972c5b0
commit
1bdb3d0372
1 file changed
+4
-3
@@ -1,13 +1,14 @@
|
|||||||
const categories = require('../data/categories')
|
const categories = require('../data/categories')
|
||||||
const parser = require('./parser')
|
const parser = require('./parser')
|
||||||
const utils = require('./utils')
|
const utils = require('./utils')
|
||||||
|
const file = require('./file')
|
||||||
|
|
||||||
const db = {}
|
const db = {}
|
||||||
|
|
||||||
db.load = async function () {
|
db.load = async function () {
|
||||||
const items = parser.parseIndex()
|
let files = await file.list()
|
||||||
for (const item of items) {
|
for (const file of files) {
|
||||||
const playlist = await parser.parsePlaylist(item.url)
|
const playlist = await parser.parsePlaylist(file)
|
||||||
db.playlists.add(playlist)
|
db.playlists.add(playlist)
|
||||||
for (const channel of playlist.channels) {
|
for (const channel of playlist.channels) {
|
||||||
db.channels.add(channel)
|
db.channels.add(channel)
|
||||||
|
|||||||
Reference in new issue
Block a user