From 79558f9ff765e2fee9a582671c1af550b72480e8 Mon Sep 17 00:00:00 2001 From: QingXia-Ela Date: Sun, 25 Aug 2024 11:20:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E8=A7=A6=E5=8F=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E8=AF=A5=E5=88=97=E8=A1=A8=E6=97=B6=E8=B7=AF=E7=94=B1=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- .../LeftList/components/CtxMenu/index.tsx | 19 ++++++++++++++----- src/store/models/customPlaylist/index.ts | 2 -- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 3cfb192..d4f5ff0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "monster-siren-desktop", "private": true, - "version": "1.1.0", + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", @@ -91,4 +91,4 @@ "website-scraper": "^5.3.1", "ws": "^8.13.0" } -} +} \ No newline at end of file diff --git a/src/pages/playlist/components/LeftList/components/CtxMenu/index.tsx b/src/pages/playlist/components/LeftList/components/CtxMenu/index.tsx index 6401d10..c067bb8 100644 --- a/src/pages/playlist/components/LeftList/components/CtxMenu/index.tsx +++ b/src/pages/playlist/components/LeftList/components/CtxMenu/index.tsx @@ -1,3 +1,4 @@ +import { getAlbumDetail } from '@/api/modules/album'; import Button from '@/components/Button'; import BlackMenuItem from '@/components/ContextMenu/BlackMenuV2/BlackMenuItem'; import Divider from '@/components/ContextMenu/BlackMenuV2/Divider'; @@ -77,12 +78,20 @@ async function removePlaylistWithNotice(cid: string) { function PlaylistLeftCtxMenu({ cid, handleClose }: PlaylistLeftCtxMenuProps) { const [confirmDel, setConfirmDel] = useState(false); const [modifyInfo, setModifyInfo] = useState(false); - const play = () => { - SirenStore.dispatch({ - type: 'musicPlay/toAlbum', - cid, - }); + const play = async () => { handleClose(); + const res = await (await getAlbumDetail(cid)).json(); + const songId = res.data.songs[0]?.cid + if (songId) { + SirenStore.dispatch({ + type: 'player/selectSong', + cid: songId, + }); + SirenStore.dispatch({ + type: 'player/setIsPlaying', + isPlaying: true, + }); + } }; const callTauriDeletePlaylist = async () => { handleClose(); diff --git a/src/store/models/customPlaylist/index.ts b/src/store/models/customPlaylist/index.ts index 6fd6c5c..75e2582 100644 --- a/src/store/models/customPlaylist/index.ts +++ b/src/store/models/customPlaylist/index.ts @@ -20,8 +20,6 @@ invoke('plugin:playlist|get_all_playlists', { }); export async function addSongToPlaylist(playlistId: string, song: any) { - console.log(song); - await invoke('plugin:playlist|add_song_to_playlist', { playlistId, song,