feat: enhance (#1016)

This commit is contained in:
Hawtim 2021-10-28 01:09:00 +08:00 committed by GitHub
parent 9b565c41c2
commit ee59479ff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 12 deletions

View File

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

View File

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

View File

@ -60,7 +60,9 @@
</div>
<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>
@ -85,6 +87,7 @@
import ArtistsInLine from '@/components/ArtistsInLine.vue';
import ExplicitSymbol from '@/components/ExplicitSymbol.vue';
import { mapState } from 'vuex';
import { isNil } from 'lodash';
export default {
name: 'TrackListItem',
@ -117,8 +120,9 @@ export default {
return image + '?param=224y224';
},
artists() {
if (this.track.ar !== undefined) return this.track.ar;
if (this.track.artists !== undefined) return this.track.artists;
const { ar, artists } = this.track;
if (!isNil(ar)) return ar;
if (!isNil(artists)) return artists;
return [];
},
album() {

View File

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

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({

View File

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