mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: updates (#1462)
* fix: IconButton disable * feat(components/Player): heart图标跟随用户喜欢的歌曲变化 * fix(pages/Artist): 对最新发行和EP判断是否存在数据 * fix(utils/player): 音频加载完成后检查id 避免切歌太快,导致已经被切歌音频覆盖当前音频 * update * fix(utils/player): update * fix(components/Player): 删掉多余的!! * _initFM() private * Update player.ts Co-authored-by: qier222 <qier222@outlook.com>
This commit is contained in:
parent
744247143b
commit
f5ab5ea754
4 changed files with 49 additions and 30 deletions
|
|
@ -2,6 +2,8 @@ import ArtistInline from '@/components/ArtistsInline'
|
|||
import IconButton from '@/components/IconButton'
|
||||
import Slider from '@/components/Slider'
|
||||
import SvgIcon from '@/components/SvgIcon'
|
||||
import useUser from '@/hooks/useUser'
|
||||
import useUserLikedSongsIDs from '@/hooks/useUserLikedSongsIDs'
|
||||
import { player } from '@/store'
|
||||
import { resizeImage } from '@/utils/common'
|
||||
import { State as PlayerState, Mode as PlayerMode } from '@/utils/player'
|
||||
|
|
@ -15,6 +17,12 @@ const PlayingTrack = () => {
|
|||
[snappedPlayer.trackListSource]
|
||||
)
|
||||
|
||||
// Liked songs ids
|
||||
const { data: user } = useUser()
|
||||
const { data: userLikedSongs } = useUserLikedSongsIDs({
|
||||
uid: user?.account?.id ?? 0,
|
||||
})
|
||||
|
||||
const toAlbum = () => {
|
||||
const id = track?.al?.id
|
||||
if (id) navigate(`/album/${id}`)
|
||||
|
|
@ -60,7 +68,11 @@ const PlayingTrack = () => {
|
|||
<IconButton onClick={() => toast('施工中...')}>
|
||||
<SvgIcon
|
||||
className='h-6 w-6 text-black dark:text-white'
|
||||
name='heart-outline'
|
||||
name={
|
||||
track?.id && userLikedSongs?.ids?.includes(track.id)
|
||||
? 'heart'
|
||||
: 'heart-outline'
|
||||
}
|
||||
/>
|
||||
</IconButton>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue