mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
fix: bugs
This commit is contained in:
parent
044720c531
commit
fd16d470bd
5 changed files with 21 additions and 18 deletions
|
|
@ -66,14 +66,14 @@
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<ContextMenu ref="userProfileMenu">
|
<ContextMenu ref="userProfileMenu">
|
||||||
<div class="item" @click="toLogin" v-if="!isLooseLoggedIn">
|
|
||||||
<svg-icon icon-class="login" />
|
|
||||||
{{ $t("login.login") }}
|
|
||||||
</div>
|
|
||||||
<div class="item" @click="toSettings">
|
<div class="item" @click="toSettings">
|
||||||
<svg-icon icon-class="settings" />
|
<svg-icon icon-class="settings" />
|
||||||
{{ $t("library.userProfileMenu.settings") }}
|
{{ $t("library.userProfileMenu.settings") }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="item" @click="toLogin" v-if="!isLooseLoggedIn">
|
||||||
|
<svg-icon icon-class="login" />
|
||||||
|
{{ $t("login.login") }}
|
||||||
|
</div>
|
||||||
<div class="item" @click="logout" v-if="isLooseLoggedIn">
|
<div class="item" @click="logout" v-if="isLooseLoggedIn">
|
||||||
<svg-icon icon-class="logout" />
|
<svg-icon icon-class="logout" />
|
||||||
{{ $t("library.userProfileMenu.logout") }}
|
{{ $t("library.userProfileMenu.logout") }}
|
||||||
|
|
|
||||||
|
|
@ -119,11 +119,8 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(["updateLikedSongs", "updateModal"]),
|
...mapMutations(["updateLikedSongs", "updateModal"]),
|
||||||
...mapActions(["nextTrack", "playTrackOnListByID", "showToast"]),
|
...mapActions(["nextTrack", "showToast"]),
|
||||||
openMenu(e, track) {
|
openMenu(e, track) {
|
||||||
if (!track.playable) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.rightClickedTrack = track;
|
this.rightClickedTrack = track;
|
||||||
this.$refs.menu.openMenu(e);
|
this.$refs.menu.openMenu(e);
|
||||||
},
|
},
|
||||||
|
|
@ -141,7 +138,7 @@ export default {
|
||||||
} else if (this.dbclickTrackFunc === "none") {
|
} else if (this.dbclickTrackFunc === "none") {
|
||||||
// do nothing
|
// do nothing
|
||||||
} else if (this.dbclickTrackFunc === "playTrackOnListByID") {
|
} else if (this.dbclickTrackFunc === "playTrackOnListByID") {
|
||||||
this.playTrackOnListByID(trackID);
|
this.$store.state.player.playTrackOnListByID(trackID);
|
||||||
} else if (this.dbclickTrackFunc === "playPlaylistByID") {
|
} else if (this.dbclickTrackFunc === "playPlaylistByID") {
|
||||||
this.$store.state.player.playPlaylistByID(this.id, trackID);
|
this.$store.state.player.playPlaylistByID(this.id, trackID);
|
||||||
} else if (this.dbclickTrackFunc === "playAList") {
|
} else if (this.dbclickTrackFunc === "playAList") {
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,7 @@
|
||||||
<div></div>
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="album" v-if="!isTracklist && !isAlbum">
|
<div class="album" v-if="!isTracklist && !isAlbum">
|
||||||
<router-link :to="`/album/${track.al.id}`">{{
|
<router-link :to="`/album/${album.id}`">{{ album.name }}</router-link>
|
||||||
track.al.name
|
|
||||||
}}</router-link>
|
|
||||||
<div></div>
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions" v-if="!isTracklist">
|
<div class="actions" v-if="!isTracklist">
|
||||||
|
|
@ -66,8 +64,7 @@
|
||||||
<svg-icon
|
<svg-icon
|
||||||
icon-class="heart"
|
icon-class="heart"
|
||||||
:style="{
|
:style="{
|
||||||
visibility:
|
visibility: focus && !isLiked ? 'visible' : 'hidden',
|
||||||
focus && !isLiked && track.playable ? 'visible' : 'hidden',
|
|
||||||
}"
|
}"
|
||||||
></svg-icon>
|
></svg-icon>
|
||||||
<svg-icon icon-class="heart-solid" v-show="isLiked"></svg-icon>
|
<svg-icon icon-class="heart-solid" v-show="isLiked"></svg-icon>
|
||||||
|
|
@ -111,6 +108,9 @@ export default {
|
||||||
if (this.track.artists !== undefined) return this.track.artists;
|
if (this.track.artists !== undefined) return this.track.artists;
|
||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
|
album() {
|
||||||
|
return this.track.album || this.track.al;
|
||||||
|
},
|
||||||
type() {
|
type() {
|
||||||
return this.$parent.type;
|
return this.$parent.type;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ export default class {
|
||||||
if (firstTrackID !== "first") this._shuffledList.unshift(firstTrackID);
|
if (firstTrackID !== "first") this._shuffledList.unshift(firstTrackID);
|
||||||
}
|
}
|
||||||
async _scrobble(track, time, complete = false) {
|
async _scrobble(track, time, complete = false) {
|
||||||
console.log("scrobble");
|
console.log(`scrobble ${track.name} by ${track.ar[0].name}`);
|
||||||
const trackDuration = ~~(track.dt / 1000);
|
const trackDuration = ~~(track.dt / 1000);
|
||||||
scrobble({
|
scrobble({
|
||||||
id: track.id,
|
id: track.id,
|
||||||
|
|
@ -173,7 +173,6 @@ export default class {
|
||||||
store.state.lastfm.key !== undefined &&
|
store.state.lastfm.key !== undefined &&
|
||||||
(time >= trackDuration / 2 || time >= 240)
|
(time >= trackDuration / 2 || time >= 240)
|
||||||
) {
|
) {
|
||||||
console.log({ currentTrack: track });
|
|
||||||
const timestamp = ~~(new Date().getTime() / 1000) - time;
|
const timestamp = ~~(new Date().getTime() / 1000) - time;
|
||||||
trackScrobble({
|
trackScrobble({
|
||||||
artist: track.ar[0].name,
|
artist: track.ar[0].name,
|
||||||
|
|
@ -425,7 +424,6 @@ export default class {
|
||||||
document.title = `${this._currentTrack.name} · ${this._currentTrack.ar[0].name} - YesPlayMusic`;
|
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) {
|
||||||
console.log({ currentTrack: this.currentTrack });
|
|
||||||
trackUpdateNowPlaying({
|
trackUpdateNowPlaying({
|
||||||
artist: this.currentTrack.ar[0].name,
|
artist: this.currentTrack.ar[0].name,
|
||||||
track: this.currentTrack.name,
|
track: this.currentTrack.name,
|
||||||
|
|
@ -505,6 +503,12 @@ export default class {
|
||||||
this.replacePlaylist(trackIDs, id, "artist", trackID);
|
this.replacePlaylist(trackIDs, id, "artist", trackID);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
playTrackOnListByID(id, listName = "default") {
|
||||||
|
if (listName === "default") {
|
||||||
|
this._current = this._list.findIndex((t) => t === id);
|
||||||
|
}
|
||||||
|
this._replaceCurrentTrack(id);
|
||||||
|
}
|
||||||
addTrackToPlayNext(trackID, playNow = false) {
|
addTrackToPlayNext(trackID, playNow = false) {
|
||||||
this._playNextList.push(trackID);
|
this._playNextList.push(trackID);
|
||||||
if (playNow) this.playNextTrack();
|
if (playNow) this.playNextTrack();
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@ const service = axios.create({
|
||||||
|
|
||||||
service.interceptors.request.use(function (config) {
|
service.interceptors.request.use(function (config) {
|
||||||
if (!config.params) config.params = {};
|
if (!config.params) config.params = {};
|
||||||
config.params.cookie = `MUSIC_U=${Cookies.get("MUSIC_U")};`;
|
if (baseURL[0] !== "/") {
|
||||||
|
config.params.cookie = `MUSIC_U=${Cookies.get("MUSIC_U")};`;
|
||||||
|
}
|
||||||
return config;
|
return config;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue