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:
Hawtim Zhang 2020-10-22 21:44:34 +08:00 committed by GitHub
parent 56fe497db9
commit c042faa001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 1755 additions and 1445 deletions

View file

@ -27,13 +27,14 @@
<span :title="album.publishTime | formatDate">{{
new Date(album.publishTime).getFullYear()
}}</span>
<span> · {{ album.size }} {{ $t("common.songs") }}</span>,
<span> · {{ album.size }} {{ $t("common.songs") }}</span
>,
{{ albumTime | formatTime("Human") }}
</div>
<div class="description" @click="showFullDescription = true">
{{ album.description }}
</div>
<div class="buttons" style="margin-top:32px">
<div class="buttons" style="margin-top: 32px">
<ButtonTwoTone
@click.native="playAlbumByID(album.id)"
:iconClass="`play`"
@ -63,7 +64,7 @@
<div class="description-full" @click.stop>
<span>{{ album.description }}</span>
<span class="close" @click="showFullDescription = false">
{{ $t('modal.close') }}
{{ $t("modal.close") }}
</span>
</div>
</div>
@ -89,7 +90,7 @@ export default {
Cover,
ButtonTwoTone,
TrackList,
ExplicitSymbol
ExplicitSymbol,
},
data() {
return {
@ -97,27 +98,27 @@ export default {
id: 0,
picUrl: "",
artist: {
id: 0
}
id: 0,
},
},
tracks: [],
showFullDescription: false,
show: false
show: false,
};
},
created() {
getAlbum(this.$route.params.id)
.then(data => {
.then((data) => {
this.album = data.album;
this.tracks = data.songs;
NProgress.done();
this.show = true;
return this.tracks;
})
.then(tracks => {
.then((tracks) => {
// to get explicit mark
let trackIDs = tracks.map(t => t.id);
getTrackDetail(trackIDs.join(",")).then(data => {
let trackIDs = tracks.map((t) => t.id);
getTrackDetail(trackIDs.join(",")).then((data) => {
this.tracks = data.songs;
});
});
@ -126,20 +127,20 @@ export default {
...mapState(["player"]),
albumTime() {
let time = 0;
this.tracks.map(t => (time = time + t.dt));
this.tracks.map((t) => (time = time + t.dt));
return time;
}
},
},
methods: {
...mapMutations(["appendTrackToPlayerList"]),
...mapActions(["playFirstTrackOnList", "playTrackOnListByID"]),
playAlbumByID(id, trackID = "first") {
if (this.tracks.find(t => t.playable !== false) === undefined) {
if (this.tracks.find((t) => t.playable !== false) === undefined) {
return;
}
playAlbumByID(id, trackID);
}
}
},
},
};
</script>