mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-09 11:52:35 +03:00
"Add to Playlist" on AlbumList actions (#1257)
* added a dependency npm was complaining about added playlist to album actions * removed chokidar dependency Co-authored-by: Skrtansh Rajput <srajput@alienvault.com>
This commit is contained in:
parent
615cac2ec4
commit
fb4eefced5
@ -11,7 +11,14 @@ 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 { RiPlayListAddFill, RiPlayList2Fill } from 'react-icons/ri'
|
import { RiPlayListAddFill, RiPlayList2Fill } from 'react-icons/ri'
|
||||||
import { playNext, addTracks, playTracks, shuffleTracks } from '../actions'
|
import PlaylistAddIcon from '@material-ui/icons/PlaylistAdd'
|
||||||
|
import {
|
||||||
|
playNext,
|
||||||
|
addTracks,
|
||||||
|
playTracks,
|
||||||
|
shuffleTracks,
|
||||||
|
openAddToPlaylist,
|
||||||
|
} from '../actions'
|
||||||
import subsonic from '../subsonic'
|
import subsonic from '../subsonic'
|
||||||
import { formatBytes } from '../utils'
|
import { formatBytes } from '../utils'
|
||||||
import { useMediaQuery, makeStyles } from '@material-ui/core'
|
import { useMediaQuery, makeStyles } from '@material-ui/core'
|
||||||
@ -52,6 +59,10 @@ const AlbumActions = ({
|
|||||||
dispatch(shuffleTracks(data, ids))
|
dispatch(shuffleTracks(data, ids))
|
||||||
}, [dispatch, data, ids])
|
}, [dispatch, data, ids])
|
||||||
|
|
||||||
|
const handleAddToPlaylist = React.useCallback(() => {
|
||||||
|
dispatch(openAddToPlaylist({ selectedIds: ids }))
|
||||||
|
}, [dispatch, ids])
|
||||||
|
|
||||||
const handleDownload = React.useCallback(() => {
|
const handleDownload = React.useCallback(() => {
|
||||||
subsonic.download(record.id)
|
subsonic.download(record.id)
|
||||||
}, [record])
|
}, [record])
|
||||||
@ -84,6 +95,12 @@ const AlbumActions = ({
|
|||||||
>
|
>
|
||||||
<RiPlayListAddFill />
|
<RiPlayListAddFill />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={handleAddToPlaylist}
|
||||||
|
label={translate('resources.album.actions.addToPlaylist')}
|
||||||
|
>
|
||||||
|
<PlaylistAddIcon />
|
||||||
|
</Button>
|
||||||
{config.enableDownloads && (
|
{config.enableDownloads && (
|
||||||
<Button
|
<Button
|
||||||
onClick={handleDownload}
|
onClick={handleDownload}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user