mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
feat: prettier task supported (#40)
* feat: add config to resolve path alias. * feat: use vue-i18n for language switch * feat: add .editorconfig for ide * fix: add no-referrer to avoid CROB * fix: setCookie and fix typo * feat: integrate vue-i18n * feat: player component i18n support * fix: duplicate key warning in explore page * fix: like songs number changed in library page * fire: remove todo * fix: same text search on enter will cause error * fix: scrobble error params type * feat: prettier task supported * fix: prettier ignore config update * fix: conflict
This commit is contained in:
parent
56fe497db9
commit
c042faa001
44 changed files with 1755 additions and 1445 deletions
|
|
@ -76,23 +76,23 @@ export default {
|
|||
user: {
|
||||
profile: {
|
||||
avatarUrl: "",
|
||||
nickname: ""
|
||||
}
|
||||
nickname: "",
|
||||
},
|
||||
},
|
||||
playlists: [],
|
||||
hasMorePlaylists: true,
|
||||
likedSongsPlaylist: {
|
||||
id: 0,
|
||||
trackCount: 0
|
||||
trackCount: 0,
|
||||
},
|
||||
likedSongs: [],
|
||||
likedSongIDs: [],
|
||||
lyric: undefined
|
||||
lyric: undefined,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
NProgress.start();
|
||||
userDetail(this.settings.user.userId).then(data => {
|
||||
userDetail(this.settings.user.userId).then((data) => {
|
||||
this.user = data;
|
||||
});
|
||||
},
|
||||
|
|
@ -107,7 +107,7 @@ export default {
|
|||
pickedLyric() {
|
||||
if (this.lyric === undefined) return "";
|
||||
let lyric = this.lyric.split("\n");
|
||||
lyric = lyric.filter(l => {
|
||||
lyric = lyric.filter((l) => {
|
||||
if (l.includes("作词") || l.includes("作曲")) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -120,9 +120,9 @@ export default {
|
|||
return [
|
||||
lyric[lineIndex].split("]")[1],
|
||||
lyric[lineIndex + 1].split("]")[1],
|
||||
lyric[lineIndex + 2].split("]")[1]
|
||||
lyric[lineIndex + 2].split("]")[1],
|
||||
];
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
playLikedSongs() {
|
||||
|
|
@ -141,8 +141,8 @@ export default {
|
|||
userPlaylist({
|
||||
uid: this.settings.user.userId,
|
||||
offset: this.playlists.length === 0 ? 0 : this.playlists.length - 1,
|
||||
timestamp: new Date().getTime()
|
||||
}).then(data => {
|
||||
timestamp: new Date().getTime(),
|
||||
}).then((data) => {
|
||||
if (replace) {
|
||||
this.playlists = data.playlist;
|
||||
} else {
|
||||
|
|
@ -153,11 +153,11 @@ export default {
|
|||
},
|
||||
getLikedSongs(getLyric = true) {
|
||||
getPlaylistDetail(this.settings.user.likedSongPlaylistID, true).then(
|
||||
data => {
|
||||
(data) => {
|
||||
this.likedSongsPlaylist = data.playlist;
|
||||
let TrackIDs = data.playlist.trackIds.slice(0, 20).map(t => t.id);
|
||||
let TrackIDs = data.playlist.trackIds.slice(0, 20).map((t) => t.id);
|
||||
this.likedSongIDs = TrackIDs;
|
||||
getTrackDetail(this.likedSongIDs.join(",")).then(data => {
|
||||
getTrackDetail(this.likedSongIDs.join(",")).then((data) => {
|
||||
this.likedSongs = data.songs;
|
||||
NProgress.done();
|
||||
this.show = true;
|
||||
|
|
@ -169,16 +169,16 @@ export default {
|
|||
getRandomLyric() {
|
||||
getLyric(
|
||||
this.likedSongIDs[randomNum(0, this.likedSongIDs.length - 1)]
|
||||
).then(data => {
|
||||
).then((data) => {
|
||||
if (data.lrc !== undefined) this.lyric = data.lrc.lyric;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
likedSongsInState() {
|
||||
this.getLikedSongs(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue