Adding playlist button to Playlist actions
This commit is contained in:
parent
8549451ee7
commit
8fe335ed97
|
@ -9,9 +9,10 @@ import {
|
||||||
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
|
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
|
||||||
import ShuffleIcon from '@material-ui/icons/Shuffle'
|
import ShuffleIcon from '@material-ui/icons/Shuffle'
|
||||||
import CloudDownloadOutlinedIcon from '@material-ui/icons/CloudDownloadOutlined'
|
import CloudDownloadOutlinedIcon from '@material-ui/icons/CloudDownloadOutlined'
|
||||||
|
import AddToQueueIcon from '@material-ui/icons/AddToQueue'
|
||||||
import QueueMusicIcon from '@material-ui/icons/QueueMusic'
|
import QueueMusicIcon from '@material-ui/icons/QueueMusic'
|
||||||
import { httpClient } from '../dataProvider'
|
import { httpClient } from '../dataProvider'
|
||||||
import { playTracks, shuffleTracks } from '../audioplayer'
|
import { addTracks, playTracks, shuffleTracks } from '../audioplayer'
|
||||||
import { M3U_MIME_TYPE, REST_URL } from '../consts'
|
import { M3U_MIME_TYPE, REST_URL } from '../consts'
|
||||||
import subsonic from '../subsonic'
|
import subsonic from '../subsonic'
|
||||||
|
|
||||||
|
@ -31,6 +32,10 @@ const PlaylistActions = ({
|
||||||
dispatch(playTracks(data, ids))
|
dispatch(playTracks(data, ids))
|
||||||
}, [dispatch, data, ids])
|
}, [dispatch, data, ids])
|
||||||
|
|
||||||
|
const handlePlayLater = React.useCallback(() => {
|
||||||
|
dispatch(addTracks(data, ids))
|
||||||
|
}, [dispatch, data, ids])
|
||||||
|
|
||||||
const handleShuffle = React.useCallback(() => {
|
const handleShuffle = React.useCallback(() => {
|
||||||
dispatch(shuffleTracks(data, ids))
|
dispatch(shuffleTracks(data, ids))
|
||||||
}, [dispatch, data, ids])
|
}, [dispatch, data, ids])
|
||||||
|
@ -77,6 +82,12 @@ const PlaylistActions = ({
|
||||||
>
|
>
|
||||||
<CloudDownloadOutlinedIcon />
|
<CloudDownloadOutlinedIcon />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={handlePlayLater}
|
||||||
|
label={translate('resources.album.actions.addToQueue')}
|
||||||
|
>
|
||||||
|
<AddToQueueIcon />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={handleExport}
|
onClick={handleExport}
|
||||||
label={translate('resources.playlist.actions.export')}
|
label={translate('resources.playlist.actions.export')}
|
||||||
|
|
Loading…
Reference in New Issue