diff --git a/src/components/DailyTracksCard.vue b/src/components/DailyTracksCard.vue index 06940aa..ee6362b 100644 --- a/src/components/DailyTracksCard.vue +++ b/src/components/DailyTracksCard.vue @@ -49,6 +49,7 @@ export default { ...mapActions(["showToast"]), ...mapMutations(["updateDailyTracks"]), loadDailyTracks() { + if (!isAccountLoggedIn()) return; dailyRecommendTracks() .then((result) => { this.updateDailyTracks(result.data.dailySongs); diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index 36f4499..833c690 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue @@ -168,7 +168,11 @@ export default { window.open("https://github.com/qier222/YesPlayMusic"); }, toLogin() { - this.$router.push({ name: "login" }); + if (process.env.IS_ELECTRON === true) { + this.$router.push({ name: "loginAccount" }); + } else { + this.$router.push({ name: "login" }); + } }, windowMinimize() { ipcRenderer.send("minimize"); diff --git a/src/utils/db.js b/src/utils/db.js index abbb962..8efc9f5 100644 --- a/src/utils/db.js +++ b/src/utils/db.js @@ -7,7 +7,7 @@ const db = new Dexie("yesplaymusic"); db.version(2) .stores({ - trackSources: "&id, createTime", + trackSources: "&id", }) .upgrade((tx) => tx @@ -29,8 +29,9 @@ async function deleteExcessCache() { if ( store.state.settings.cacheLimit === false || tracksCacheBytes < store.state.settings.cacheLimit * Math.pow(1024, 2) - ) + ) { return; + } try { const delCache = await db.trackSources.orderBy("createTime").first(); await db.trackSources.delete(delCache.id); diff --git a/src/views/lyrics.vue b/src/views/lyrics.vue index eb50a46..4afe99d 100644 --- a/src/views/lyrics.vue +++ b/src/views/lyrics.vue @@ -39,23 +39,23 @@
{{ currentTrack.ar[0].name }} + >{{ artist.name }} - {{ currentTrack.al.name }} + >{{ album.name }}
{ if (!data?.lrc?.lyric) { this.lyric = []; @@ -300,12 +309,12 @@ export default { }, setSeek() { let value = this.$refs.progress.getValue(); - this.$parent.$refs.player.setProgress(value); - this.$parent.$refs.player.player.seek(value); + this.playerRef.setProgress(value); + this.playerRef.player.seek(value); }, seek(value) { - this.$parent.$refs.player.setProgress(value); - this.$parent.$refs.player.player.seek(value); + this.playerRef.setProgress(value); + this.playerRef.player.seek(value); }, clickLyricLine(value) { if (window.getSelection().toString().length === 0) { @@ -336,9 +345,9 @@ export default { const showLyricsTranslation = this.$store.state.settings .showLyricsTranslation; if (showLyricsTranslation && line.contents[1]) { - return `${line.contents[0]}
${line.contents[1]}
`; + return `${line?.contents[0]}
${line.contents[1]}
`; } else { - return `${line.contents[0]}`; + return `${line?.contents[0]}`; } }, moveToFMTrash() {