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