mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
fix: bugs (#1525)
* fix(component/Lyric): 点击歌手名字跳转后不会关闭歌词面板 * fix: 移除build.sqlite3.js中的dll复制 当前使用的better-sqlite3版本已经支持仅单个node文件,不需要也不再构建dll文件 * fix: 对歌词使用更精确的key,避免多个歌词时间相同时的key相同错误 * update
This commit is contained in:
parent
3a204dc7bb
commit
e6b1b91c01
5 changed files with 16 additions and 10 deletions
|
|
@ -100,12 +100,6 @@ const build = async arch => {
|
||||||
'./node_modules/better-sqlite3/build/Release/better_sqlite3.node',
|
'./node_modules/better-sqlite3/build/Release/better_sqlite3.node',
|
||||||
`./dist/main/better_sqlite3_${arch}.node`
|
`./dist/main/better_sqlite3_${arch}.node`
|
||||||
)
|
)
|
||||||
if (isWin) {
|
|
||||||
fs.copyFileSync(
|
|
||||||
'./node_modules/better-sqlite3/build/Release/sqlite3.dll',
|
|
||||||
'./dist/main/sqlite3.dll'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
console.error(pc.red('Build failed!'))
|
console.error(pc.red('Build failed!'))
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,23 @@ const ArtistInline = ({
|
||||||
artists,
|
artists,
|
||||||
className,
|
className,
|
||||||
disableLink,
|
disableLink,
|
||||||
|
onClick,
|
||||||
}: {
|
}: {
|
||||||
artists: Artist[]
|
artists: Artist[]
|
||||||
className?: string
|
className?: string
|
||||||
disableLink?: boolean
|
disableLink?: boolean
|
||||||
|
onClick?: (artistId: number) => void
|
||||||
}) => {
|
}) => {
|
||||||
if (!artists) return <div></div>
|
if (!artists) return <div></div>
|
||||||
|
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const handleClick = (id: number) => {
|
const handleClick = (id: number) => {
|
||||||
id !== 0 && !disableLink && navigate(`/artist/${id}`)
|
if (id === 0 || disableLink) return
|
||||||
|
if (!onClick) {
|
||||||
|
navigate(`/artist/${id}`)
|
||||||
|
} else {
|
||||||
|
onClick(id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ const Lyric = ({ className }: { className?: string }) => {
|
||||||
{displayLines.map(({ content, time }, index) => {
|
{displayLines.map(({ content, time }, index) => {
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
key={time}
|
key={`${String(index)}-${String(time)}`}
|
||||||
custom={index}
|
custom={index}
|
||||||
variants={variants}
|
variants={variants}
|
||||||
initial={'initial'}
|
initial={'initial'}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ const Lyric = ({ className }: { className?: string }) => {
|
||||||
return (
|
return (
|
||||||
<motion.div
|
<motion.div
|
||||||
id={String(time)}
|
id={String(time)}
|
||||||
key={time}
|
key={`${String(index)}-${String(time)}`}
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'max-w-[78%] py-[calc(100vw_*_0.0111)] text-white duration-700'
|
'max-w-[78%] py-[calc(100vw_*_0.0111)] text-white duration-700'
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,11 @@ const PlayingTrack = () => {
|
||||||
state.uiStates.showLyricPanel = false
|
state.uiStates.showLyricPanel = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const toArtist = (id: number) => {
|
||||||
|
navigate(`/artist/${id}`)
|
||||||
|
state.uiStates.showLyricPanel = false
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
|
|
@ -52,7 +57,7 @@ const PlayingTrack = () => {
|
||||||
{track?.name}
|
{track?.name}
|
||||||
</div>
|
</div>
|
||||||
<div className='line-clamp-1 -mt-0.5 inline-flex max-h-7 text-white opacity-60'>
|
<div className='line-clamp-1 -mt-0.5 inline-flex max-h-7 text-white opacity-60'>
|
||||||
<ArtistInline artists={track?.ar ?? []} />
|
<ArtistInline artists={track?.ar ?? []} onClick={toArtist} />
|
||||||
{!!track?.al?.id && (
|
{!!track?.al?.id && (
|
||||||
<span>
|
<span>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue