feat: add song title translate (#691)

This commit is contained in:
memorydream 2021-05-24 12:21:50 +08:00 committed by GitHub
parent 427806b0d7
commit 6910d5ba87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,9 @@
<span v-if="isAlbum && track.mark === 1318912" class="explicit-symbol"
><ExplicitSymbol
/></span>
<span v-if="isTranslate" :title="translate" class="translate">
- ({{ translate }})
</span>
</div>
<div v-if="!isAlbum" class="artist">
<span
@ -111,12 +114,26 @@ export default {
album() {
return this.track.album || this.track.al;
},
translate() {
let t;
if (this.track.tns?.length > 0) t = this.track.tns[0];
else if (this.track.al.tns?.length > 0) t = this.track.al.tns[0];
else t = this.track.alia[0];
return t;
},
type() {
return this.$parent.type;
},
isAlbum() {
return this.type === 'album';
},
isTranslate() {
return (
this.track.tns?.length > 0 ||
this.track.al.tns?.length > 0 ||
this.track.alia?.length > 0
);
},
isTracklist() {
return this.type === 'tracklist';
},
@ -262,6 +279,9 @@ button {
font-size: 14px;
opacity: 0.72;
}
.translate {
color: #aeaeae;
}
}
.artist {
margin-top: 2px;