mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-12 03:26:07 +08:00
导入时无需调用upgradeFavorites
This commit is contained in:
@@ -351,7 +351,6 @@ export default {
|
|||||||
star.bulkAdd(json).then(e => {
|
star.bulkAdd(json).then(e => {
|
||||||
this.getFavorites()
|
this.getFavorites()
|
||||||
})
|
})
|
||||||
this.upgradeFavorites()
|
|
||||||
})
|
})
|
||||||
this.$message.success('导入收藏成功')
|
this.$message.success('导入收藏成功')
|
||||||
}
|
}
|
||||||
@@ -359,25 +358,6 @@ export default {
|
|||||||
this.$message.error(err)
|
this.$message.error(err)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async upgradeFavorites () {
|
|
||||||
const allStar = star.all()
|
|
||||||
allStar.forEach(async element => {
|
|
||||||
const docs = {
|
|
||||||
key: element.key,
|
|
||||||
ids: element.ids,
|
|
||||||
name: element.name,
|
|
||||||
type: element.type,
|
|
||||||
year: element.year,
|
|
||||||
last: element.last,
|
|
||||||
note: element.note
|
|
||||||
}
|
|
||||||
const db = await star.find({ key: element.key, ids: element.ids })
|
|
||||||
if (!db) {
|
|
||||||
star.add(docs)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.getFavorites()
|
|
||||||
},
|
|
||||||
clearFavoritesEvent () {
|
clearFavoritesEvent () {
|
||||||
star.clear().then(e => {
|
star.clear().then(e => {
|
||||||
this.getFavorites()
|
this.getFavorites()
|
||||||
|
|||||||
Reference in New Issue
Block a user