mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
feat: add music language preference
This commit is contained in:
parent
f89fc84f95
commit
78d90f15f5
5 changed files with 46 additions and 14 deletions
|
|
@ -121,12 +121,22 @@ export default {
|
|||
this.show = true;
|
||||
});
|
||||
newAlbums({
|
||||
area: 'EA',
|
||||
area: this.settings.musicLanguage ?? 'ALL',
|
||||
limit: 10,
|
||||
}).then(data => {
|
||||
this.newReleasesAlbum.items = data.albums;
|
||||
});
|
||||
toplistOfArtists(2).then(data => {
|
||||
|
||||
const toplistOfArtistsAreaTable = {
|
||||
all: null,
|
||||
zh: 1,
|
||||
ea: 2,
|
||||
jp: 4,
|
||||
kr: 3,
|
||||
};
|
||||
toplistOfArtists(
|
||||
toplistOfArtistsAreaTable[this.settings.musicLanguage ?? 'all']
|
||||
).then(data => {
|
||||
let indexs = [];
|
||||
while (indexs.length < 6) {
|
||||
let tmp = ~~(Math.random() * 100);
|
||||
|
|
|
|||
|
|
@ -378,15 +378,9 @@ export default {
|
|||
Vibrant.from(cover, { colorCount: 1 })
|
||||
.getPalette()
|
||||
.then(palette => {
|
||||
const color = Color.rgb(palette.DarkMuted._rgb)
|
||||
.darken(0.1)
|
||||
.rgb()
|
||||
.string();
|
||||
const color2 = Color.rgb(palette.DarkMuted._rgb)
|
||||
.lighten(0.28)
|
||||
.rotate(-30)
|
||||
.rgb()
|
||||
.string();
|
||||
const orignColor = Color.rgb(palette.DarkMuted._rgb);
|
||||
const color = orignColor.darken(0.1).rgb().string();
|
||||
const color2 = orignColor.lighten(0.28).rotate(-30).rgb().string();
|
||||
this.background = `linear-gradient(to top left, ${color}, ${color2})`;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -54,6 +54,20 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="left">
|
||||
<div class="title"> 音乐语种偏好 </div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<select v-model="musicLanguage">
|
||||
<option value="all">无偏好</option>
|
||||
<option value="zh">华语</option>
|
||||
<option value="ea">欧美</option>
|
||||
<option value="jp">日语</option>
|
||||
<option value="kr">韩语</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>音质</h3>
|
||||
<div class="item">
|
||||
|
|
@ -454,6 +468,17 @@ export default {
|
|||
this.$store.commit('changeLang', lang);
|
||||
},
|
||||
},
|
||||
musicLanguage: {
|
||||
get() {
|
||||
return this.settings.musicLanguage ?? 'all';
|
||||
},
|
||||
set(value) {
|
||||
this.$store.commit('updateSettings', {
|
||||
key: 'musicLanguage',
|
||||
value,
|
||||
});
|
||||
},
|
||||
},
|
||||
appearance: {
|
||||
get() {
|
||||
if (this.settings.appearance === undefined) return 'auto';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue