feat: add like albums & follow artists function

This commit is contained in:
qier222 2020-10-26 15:46:02 +08:00
parent 81ec2fe6b9
commit 2f41e0237d
28 changed files with 461 additions and 145 deletions

View file

@ -146,13 +146,13 @@ export default {
this.progress = ~~this.howler.seek();
}, 1000);
if (isAccountLoggedIn()) {
userLikedSongsIDs(this.settings.user.userId).then((data) => {
userLikedSongsIDs(this.data.user.userId).then((data) => {
this.updateLikedSongs(data.ids);
});
}
},
computed: {
...mapState(["player", "howler", "settings", "liked", "accountLogin"]),
...mapState(["player", "howler", "settings", "liked", "data"]),
currentTrack() {
return this.player.currentTrack;
},
@ -175,6 +175,9 @@ export default {
let max = ~~(this.currentTrack.dt / 1000);
return max > 1 ? max - 1 : max;
},
accountLogin() {
return isAccountLoggedIn();
},
},
methods: {
...mapMutations([
@ -266,7 +269,7 @@ export default {
});
},
goToList() {
if (this.player.listInfo.id === this.settings.user.likedSongPlaylistID)
if (this.player.listInfo.id === this.data.likedSongPlaylistID)
this.$router.push({ path: "/library/liked-songs" });
else
this.$router.push({