feat: enhance (#1016)

master
Hawtim 3 years ago committed by GitHub
parent 9b565c41c2
commit ee59479ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,7 @@
"version": "0.4.2", "version": "0.4.2",
"private": true, "private": true,
"description": "A third party music player for Netease Music", "description": "A third party music player for Netease Music",
"author": "hawtim<hawtimzhang@gmail.com>", "author": "qier222<qier222@outlook.com>",
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
@ -47,14 +47,14 @@
"electron-store": "^6.0.1", "electron-store": "^6.0.1",
"electron-updater": "^4.3.5", "electron-updater": "^4.3.5",
"express": "^4.17.1", "express": "^4.17.1",
"md5": "^2.3.0",
"music-metadata": "^7.5.3",
"express-fileupload": "^1.2.0", "express-fileupload": "^1.2.0",
"express-http-proxy": "^1.6.2", "express-http-proxy": "^1.6.2",
"extract-zip": "^2.0.1", "extract-zip": "^2.0.1",
"howler": "^2.2.3", "howler": "^2.2.3",
"js-cookie": "^2.2.1", "js-cookie": "^2.2.1",
"lodash": "^4.17.20", "lodash": "^4.17.20",
"md5": "^2.3.0",
"music-metadata": "^7.5.3",
"node-vibrant": "^3.1.6", "node-vibrant": "^3.1.6",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pac-proxy-agent": "^4.1.0", "pac-proxy-agent": "^4.1.0",

@ -53,6 +53,7 @@
<input <input
ref="searchInput" ref="searchInput"
v-model="keywords" v-model="keywords"
type="search"
:placeholder="inputFocus ? '' : $t('nav.search')" :placeholder="inputFocus ? '' : $t('nav.search')"
@keydown.enter="doSearch" @keydown.enter="doSearch"
@focus="inputFocus = true" @focus="inputFocus = true"

@ -60,7 +60,9 @@
</div> </div>
<div v-if="showAlbumName" class="album"> <div v-if="showAlbumName" class="album">
<router-link :to="`/album/${album.id}`">{{ album.name }}</router-link> <router-link v-if="album && album.id" :to="`/album/${album.id}`">{{
album.name
}}</router-link>
<div></div> <div></div>
</div> </div>
@ -85,6 +87,7 @@
import ArtistsInLine from '@/components/ArtistsInLine.vue'; import ArtistsInLine from '@/components/ArtistsInLine.vue';
import ExplicitSymbol from '@/components/ExplicitSymbol.vue'; import ExplicitSymbol from '@/components/ExplicitSymbol.vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { isNil } from 'lodash';
export default { export default {
name: 'TrackListItem', name: 'TrackListItem',
@ -117,8 +120,9 @@ export default {
return image + '?param=224y224'; return image + '?param=224y224';
}, },
artists() { artists() {
if (this.track.ar !== undefined) return this.track.ar; const { ar, artists } = this.track;
if (this.track.artists !== undefined) return this.track.artists; if (!isNil(ar)) return ar;
if (!isNil(artists)) return artists;
return []; return [];
}, },
album() { album() {

@ -100,7 +100,7 @@ export default {
if (!isLooseLoggedIn()) return; if (!isLooseLoggedIn()) return;
if (isAccountLoggedIn()) { if (isAccountLoggedIn()) {
return userPlaylist({ return userPlaylist({
uid: state.data.user.userId, uid: state.data.user?.userId,
limit: 2000, // 最多只加载2000个歌单等有用户反馈问题再修 limit: 2000, // 最多只加载2000个歌单等有用户反馈问题再修
timestamp: new Date().getTime(), timestamp: new Date().getTime(),
}).then(result => { }).then(result => {

@ -235,7 +235,9 @@ export default class {
}); });
if (autoplay) { if (autoplay) {
this.play(); 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.setOutputDevice();
this._howler.once('end', () => { this._howler.once('end', () => {
@ -485,7 +487,9 @@ export default class {
if (this._howler?.playing()) return; if (this._howler?.playing()) return;
this._howler?.play(); this._howler?.play();
this._playing = true; 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()); this._playDiscordPresence(this._currentTrack, this.seek());
if (store.state.lastfm.key !== undefined) { if (store.state.lastfm.key !== undefined) {
trackUpdateNowPlaying({ trackUpdateNowPlaying({

@ -3238,9 +3238,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0" lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001208: caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001208:
version "1.0.30001208" version "1.0.30001271"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz#a999014a35cebd4f98c405930a057a0d75352eb9" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001271.tgz"
integrity sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA== integrity sha512-BBruZFWmt3HFdVPS8kceTBIguKxu4f99n5JNp06OlPD/luoAMIaIK5ieV5YjnBLH3Nysai9sxj9rpJj4ZisXOA==
capital-case@^1.0.4: capital-case@^1.0.4:
version "1.0.4" version "1.0.4"

Loading…
Cancel
Save