diff --git a/src/screens/Home/Views/Mylist/MusicList/ListMenu.tsx b/src/screens/Home/Views/Mylist/MusicList/ListMenu.tsx index fdaca7a..99021d4 100644 --- a/src/screens/Home/Views/Mylist/MusicList/ListMenu.tsx +++ b/src/screens/Home/Views/Mylist/MusicList/ListMenu.tsx @@ -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((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((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((props, ref) => { case 'remove': props.onRemove(selectInfo) break + case 'download': + props.onDownload(selectInfo) default: break } diff --git a/src/screens/Home/Views/Mylist/MusicList/index.tsx b/src/screens/Home/Views/Mylist/MusicList/index.tsx index 1be8664..64e9f8c 100644 --- a/src/screens/Home/Views/Mylist/MusicList/index.tsx +++ b/src/screens/Home/Views/Mylist/MusicList/index.tsx @@ -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)}