mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-05 19:31:21 +08:00
🎍 新增清理视频缓存功能
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
<ul>
|
||||
<draggable v-model="iptvList" @change="listUpdatedEvent">
|
||||
<transition-group>
|
||||
<li v-for="i in iptvList" :key="i.name" @click.stop="playEvent(i)" v-show="containsearchTxt(i)">
|
||||
<li v-for="(i, j) in iptvList" :key="j + i.name" @click.stop="playEvent(i)" v-show="containsearchTxt(i)">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="moveToTopEvent(i)">置顶</span>
|
||||
|
||||
@@ -42,6 +42,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="shortcut">
|
||||
<div class="title">缓存</div>
|
||||
<div class="shortcut-box">
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="clearCache">清理视频缓存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site">
|
||||
<div class="title">定位时间设置</div>
|
||||
<div class="zy-input">
|
||||
@@ -228,6 +236,14 @@ export default {
|
||||
this.updateSettingEvent()
|
||||
this.show.view = false
|
||||
},
|
||||
async clearCache () {
|
||||
const win = remote.getCurrentWindow()
|
||||
const ses = win.webContents.session
|
||||
const size = await ses.getCacheSize() / 1024 / 1024
|
||||
const mb = size.toFixed(2)
|
||||
await ses.clearCache()
|
||||
this.$message.success(`清除缓存成功, 共清理 ${mb} MB`)
|
||||
},
|
||||
updateSettingEvent () {
|
||||
this.editPlayerPath = false
|
||||
this.setting = this.d
|
||||
|
||||
Reference in New Issue
Block a user