feat: enhance (#1016)

This commit is contained in:
Hawtim 2021-10-28 01:09:00 +08:00 committed by qier222
parent 7af0e09dd6
commit 5566b2e344
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
6 changed files with 21 additions and 12 deletions

View file

@ -235,7 +235,9 @@ export default class {
});
if (autoplay) {
this.play();
document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`;
if (this._currentTrack.name) {
document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`;
}
}
this.setOutputDevice();
this._howler.once('end', () => {
@ -485,7 +487,9 @@ export default class {
if (this._howler?.playing()) return;
this._howler?.play();
this._playing = true;
document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`;
if (this._currentTrack.name) {
document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`;
}
this._playDiscordPresence(this._currentTrack, this.seek());
if (store.state.lastfm.key !== undefined) {
trackUpdateNowPlaying({