mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-10 00:02:16 +08:00
添加recommandation数据库,支持更新推荐
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import Dexie from 'dexie'
|
||||
import { setting, sites, localKey, iptv } from './initData'
|
||||
import { setting, sites, localKey, iptv, recommandations } from './initData'
|
||||
|
||||
const db = new Dexie('zy')
|
||||
|
||||
@@ -9,6 +9,7 @@ db.version(4).stores({
|
||||
setting: 'id, theme, site, shortcut, view, externalPlayer, searchAllSites, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode',
|
||||
shortcut: 'name, key, desc',
|
||||
star: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',
|
||||
recommandation: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',
|
||||
sites: '++id, key, name, api, download, isActive, group',
|
||||
history: '++id, [site+ids], name, type, year, index, time',
|
||||
mini: 'id, site, ids, name, index, time',
|
||||
@@ -20,6 +21,7 @@ db.on('populate', () => {
|
||||
db.sites.bulkAdd(sites)
|
||||
db.shortcut.bulkAdd(localKey)
|
||||
db.iptv.bulkAdd(iptv)
|
||||
db.recommandation.bulkAdd(recommandations)
|
||||
})
|
||||
|
||||
db.open()
|
||||
|
||||
@@ -7,6 +7,7 @@ import sites from './sites'
|
||||
import search from './search'
|
||||
import iptvSearch from './iptvSearch'
|
||||
import iptv from './iptv'
|
||||
import recommandation from './recommandation'
|
||||
|
||||
export {
|
||||
history,
|
||||
@@ -17,5 +18,6 @@ export {
|
||||
sites,
|
||||
iptv,
|
||||
search,
|
||||
iptvSearch
|
||||
iptvSearch,
|
||||
recommandation
|
||||
}
|
||||
|
||||
28
src/lib/dexie/recommandation.js
Normal file
28
src/lib/dexie/recommandation.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import db from './dexie'
|
||||
const { recommandation } = db
|
||||
export default {
|
||||
async add (doc) {
|
||||
return await recommandation.add(doc)
|
||||
},
|
||||
async bulkAdd (doc) {
|
||||
return await recommandation.bulkAdd(doc)
|
||||
},
|
||||
async find (doc) {
|
||||
return await recommandation.where(doc).first()
|
||||
},
|
||||
async update (id, docs) {
|
||||
return await recommandation.update(id, docs)
|
||||
},
|
||||
async all () {
|
||||
return await recommandation.toArray()
|
||||
},
|
||||
async remove (id) {
|
||||
return await recommandation.delete(id)
|
||||
},
|
||||
async get (id) {
|
||||
return await recommandation.get(id)
|
||||
},
|
||||
async clear () {
|
||||
return await recommandation.clear()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user