From 7c0f688f9d01838e9992f557e8a1d00d44f20ca7 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Mon, 28 Dec 2020 20:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Play=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9C=80=E8=BF=91=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 50f6ec6..942a255 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -121,8 +121,10 @@ - - 上次播放到:【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集 {{fmtMSS(right.history[0].time.toFixed(0))}}/{{fmtMSS(right.history[0].duration.toFixed(0))}} + + 上次播放到:【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集 + {{fmtMSS(right.history[0].time.toFixed(0))}}/{{fmtMSS(right.history[0].duration.toFixed(0))}} +
@@ -677,31 +679,18 @@ export default { async videoPlaying () { this.changeVideo() const db = await history.find({ site: this.video.key, ids: this.video.info.id }) - if (db) { - const doc = { - site: db.site, - ids: db.ids, - name: db.name, - type: db.type, - year: db.year, - index: this.video.info.index, - time: db.time, - detail: this.video.detail - } - history.update(db.id, doc) - } else { - const doc = { - site: this.video.key, - ids: this.video.info.id, - name: this.video.info.name, - type: this.video.info.type, - year: this.video.info.year, - index: this.video.info.index, - time: '', - detail: this.video.detail - } - history.add(doc) + if (db) await history.remove(db.id) + const doc = { + site: this.video.key, + ids: this.video.info.id, + name: this.video.info.name, + type: this.video.info.type, + year: this.video.info.year, + index: this.video.info.index, + time: '', + detail: this.video.detail } + history.add(doc) this.updateStar() this.timerEvent() },