mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-05-23 22:37:41 +08:00
fix bug
This commit is contained in:
parent
8577be010e
commit
62610ed6f8
@ -23,6 +23,7 @@ export interface ListMenuProps {
|
||||
onChangePosition: (selectInfo: SelectInfo) => void
|
||||
onDislikeMusic: (selectInfo: SelectInfo) => void
|
||||
onRemove: (selectInfo: SelectInfo) => void
|
||||
onDownload: (selectInfo: SelectInfo) => void
|
||||
}
|
||||
export interface ListMenuType {
|
||||
show: (selectInfo: SelectInfo, position: Position) => void
|
||||
@ -32,7 +33,7 @@ export type {
|
||||
Position,
|
||||
}
|
||||
|
||||
const hasEditMetadata = async(musicInfo: LX.Music.MusicInfo) => {
|
||||
const hasEditMetadata = async (musicInfo: LX.Music.MusicInfo) => {
|
||||
if (musicInfo.source != 'local') return false
|
||||
return existsFile(musicInfo.meta.filePath)
|
||||
}
|
||||
@ -62,7 +63,7 @@ export default forwardRef<ListMenuType, ListMenuProps>((props, ref) => {
|
||||
const menu = [
|
||||
{ action: 'play', label: t('play') },
|
||||
{ action: 'playLater', label: t('play_later') },
|
||||
// { action: 'download', label: '下载' },
|
||||
{ action: 'download', label: '下载' },
|
||||
{ action: 'add', label: t('add_to') },
|
||||
{ action: 'move', label: t('move_to') },
|
||||
{ action: 'copyName', label: t('copy_name') },
|
||||
@ -84,7 +85,7 @@ export default forwardRef<ListMenuType, ListMenuProps>((props, ref) => {
|
||||
const menu = [
|
||||
{ action: 'play', label: t('play') },
|
||||
{ action: 'playLater', label: t('play_later') },
|
||||
// { action: 'download', label: '下载' },
|
||||
{ action: 'download', label: '下载' },
|
||||
{ action: 'add', label: t('add_to') },
|
||||
{ action: 'move', label: t('move_to') },
|
||||
{ action: 'copyName', label: t('copy_name') },
|
||||
@ -138,6 +139,8 @@ export default forwardRef<ListMenuType, ListMenuProps>((props, ref) => {
|
||||
case 'remove':
|
||||
props.onRemove(selectInfo)
|
||||
break
|
||||
case 'download':
|
||||
props.onDownload(selectInfo)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import ListSearchBar, { type ListSearchBarType } from './ListSearchBar'
|
||||
import ListMusicSearch, { type ListMusicSearchType } from './ListMusicSearch'
|
||||
import MusicPositionModal, { type MusicPositionModalType } from './MusicPositionModal'
|
||||
import MetadataEditModal, { type MetadataEditType, type MetadataEditProps } from '@/components/MetadataEditModal'
|
||||
import { handelDownload } from '@/components/OnlineList/listAction'
|
||||
|
||||
|
||||
export default () => {
|
||||
@ -157,6 +158,7 @@ export default () => {
|
||||
onDislikeMusic={info => { void handleDislikeMusic(info.musicInfo) }}
|
||||
onCopyName={info => { handleShare(info.musicInfo) }}
|
||||
onAdd={handleAddMusic}
|
||||
onDownload={info => { handelDownload(info.musicInfo) }}
|
||||
onMove={handleMoveMusic}
|
||||
onEditMetadata={handleEditMetadata}
|
||||
onChangePosition={info => musicPositionModalRef.current?.show(info)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user