数据库调整,新增channelList,根据iptvList自动生成

This commit is contained in:
buvta
2020-11-15 23:30:00 +08:00
parent 86856397f6
commit 4683223a68
4 changed files with 29 additions and 279 deletions

View File

@@ -0,0 +1,25 @@
import db from './dexie'
const { channelList } = db
export default {
async all () {
return await channelList.toArray()
},
async clear () {
return await channelList.clear()
},
async add (doc) {
return await channelList.add(doc)
},
async bulkAdd (doc) {
return await channelList.bulkAdd(doc)
},
async find (doc) {
return await channelList.get(doc)
},
async update (id, docs) {
return await channelList.update(id, docs)
},
async remove (id) {
return await channelList.delete(id)
}
}

View File

@@ -13,7 +13,8 @@ db.version(4).stores({
sites: '++id, key, name, api, download, isActive, group',
history: '++id, [site+ids], name, type, year, index, time, duration, detail',
mini: 'id, mode, site, ids, name, index, time, url',
iptv: '++id, name, url, group, isActive'
iptv: '++id, name, url, channelID, isActive',
channelList: '++id, name, prefer, channels, group, isActive'
})
db.on('populate', () => {

View File

@@ -7,6 +7,7 @@ import sites from './sites'
import search from './search'
import iptvSearch from './iptvSearch'
import iptv from './iptv'
import channelList from './channelList'
import recommendation from './recommendation'
export {
@@ -17,6 +18,7 @@ export {
star,
sites,
iptv,
channelList,
search,
iptvSearch,
recommendation

File diff suppressed because it is too large Load Diff