Skip to content

Commit

Permalink
renderer: support music cache limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Yujia Qiao committed Sep 10, 2021
1 parent f3f5868 commit f2804ab
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/renderer/page/Settings/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export default {
Api.getDataSize('all').then(s => this.dataSize = humanSize(s.size));
Api.getDataSize('music').then(s => this.musicSize = humanSize(s.size));
},
setMusicCacheLimit(size) {
Api.setMusicCacheLimit(size);
Api.getDataSize('music').then(s => this.musicSize = humanSize(s.size));
},
initData() {
this.refreshSize();
Api.getVersionName().then(v => this.versionName = v);
Expand Down Expand Up @@ -201,6 +205,9 @@ export default {
this.$toast.message('实际下载码率取决于歌曲最高码率和帐号最高可播放码率');
}
break;
case 'musicCacheLimit':
this.setMusicCacheLimit(val*1024*1024);
break;
}
}
});
Expand Down
12 changes: 12 additions & 0 deletions src/renderer/page/Settings/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ export const Entries = [
data: 'musicSize',
handler: 'promptClearMusicCache'
},
{
type: 'select',
title: '歌曲缓存空间限制',
prop: 'musicCacheLimit',
options: [
{ label: '无限制', value: 0 },
{ label: '128 MiB', value: 128 },
{ label: '256 MiB', value: 256 },
{ label: '512 MiB', value: 512 },
{ label: '1 GiB', value: 1024 },
]
},
{
type: 'plain',
title: '所有应用数据',
Expand Down

0 comments on commit f2804ab

Please sign in to comment.