🥀 新增任务栏显示播放进度

This commit is contained in:
Hunlongyu
2020-11-06 17:38:42 +08:00
committed by buvta
parent 7e5bd534ef
commit cd08e9e14b
3 changed files with 15 additions and 3 deletions

View File

@@ -68,7 +68,8 @@
<infinite-loading force-use-infinite-wrapper :identifier="infiniteId" @infinite="infiniteHandler"></infinite-loading>
</div>
<div class="show-table" v-if="setting.view === 'table' && !show.find">
<el-table size="mini"
<el-table
size="mini"
:data="list.filter(res => !setting.excludeR18Films || !containsR18Keywords(res.type))"
height="100%"
:empty-text="statusText"
@@ -130,7 +131,6 @@
<el-table size="mini"
:data="searchContents.filter(res => !setting.excludeR18Films || (res.type !== undefined && !containsR18Keywords(res.type)))"
height="100%"
row-key="id"
:empty-text="statusText"
@row-click="(row) => detailEvent(row.site, row)"
style="width: 100%">
@@ -367,7 +367,7 @@ export default {
const key = this.site.key
const type = this.type.tid
const page = this.pagecount
console.log(key, type, page, 'infiniteHandler')
console.log(key, type, page, 'infiniteHandler') // TODO: 初次进入会重复请求两次, 导致数据重复, 代码报错.
this.statusText = ' '
if (key && page < 1) { // OK资源前几类硬是去不掉
$state.complete()

View File

@@ -457,11 +457,18 @@ export default {
this.timerEvent()
},
changeVideo () {
const win = remote.getCurrentWindow()
win.setProgressBar(-1)
this.checkStar()
this.checkTop()
},
timerEvent () {
this.timer = setInterval(async () => {
const endTime = this.xg.duration
const currentTime = this.xg.currentTime
const progress = parseFloat((currentTime / endTime).toFixed(2))
const win = remote.getCurrentWindow()
win.setProgressBar(progress)
const db = await history.find({ site: this.video.key, ids: this.video.info.id })
if (db) {
const doc = { ...db }
@@ -1087,6 +1094,8 @@ export default {
})
},
videoStop () {
const win = remote.getCurrentWindow()
win.setProgressBar(-1)
if (this.xg.fullscreen) {
this.xg.exitFullscreen()
}

View File

@@ -198,6 +198,9 @@ export default {
const currentTime = this.xg.currentTime
const progress = (currentTime / endTime) * 100
this.progress = progress.toFixed(2)
const percent = parseFloat((currentTime / endTime).toFixed(2))
const win = remote.getCurrentWindow()
win.setProgressBar(percent)
const db = await history.find({ site: this.video.site, ids: this.video.ids })
if (db) {
const v = db