diff --git a/src/renderer/page/Settings/Settings.vue b/src/renderer/page/Settings/Settings.vue index a11a5ce8..b4f381e1 100644 --- a/src/renderer/page/Settings/Settings.vue +++ b/src/renderer/page/Settings/Settings.vue @@ -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); @@ -201,6 +205,9 @@ export default { this.$toast.message('实际下载码率取决于歌曲最高码率和帐号最高可播放码率'); } break; + case 'musicCacheLimit': + this.setMusicCacheLimit(val*1024*1024); + break; } } }); diff --git a/src/renderer/page/Settings/entries.js b/src/renderer/page/Settings/entries.js index 241447f2..3209797f 100644 --- a/src/renderer/page/Settings/entries.js +++ b/src/renderer/page/Settings/entries.js @@ -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: '所有应用数据',