mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: add "Automatically Cache Songs" option to settings page
This commit is contained in:
parent
8c17b70f3c
commit
ff94f011aa
2 changed files with 56 additions and 14 deletions
|
|
@ -74,10 +74,26 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="left">
|
||||
<div class="title"> Automatically Cache Songs </div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="toggle">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="automatically-cache-songs"
|
||||
id="automatically-cache-songs"
|
||||
v-model="automaticallyCacheSongs"
|
||||
/>
|
||||
<label for="automatically-cache-songs"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="left">
|
||||
<div class="title"
|
||||
>Cached {{ tracksCache.length }} songs ({{ tracksCache.size }})</div
|
||||
>Cached {{ tracksCache.length }} Songs ({{ tracksCache.size }})</div
|
||||
>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
|
@ -223,6 +239,21 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
automaticallyCacheSongs: {
|
||||
get() {
|
||||
if (this.settings.automaticallyCacheSongs === undefined) return false;
|
||||
return this.settings.automaticallyCacheSongs;
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit("updateSettings", {
|
||||
key: "automaticallyCacheSongs",
|
||||
value,
|
||||
});
|
||||
if (value === false) {
|
||||
this.clearCache("tracks");
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
logout() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue