mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-16 20:12:22 +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 CloudDownloadOutlinedIcon from '@material-ui/icons/CloudDownloadOutlined'
|
||||
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 { formatBytes } from '../utils'
|
||||
import { useMediaQuery, makeStyles } from '@material-ui/core'
|
||||
@ -52,6 +59,10 @@ const AlbumActions = ({
|
||||
dispatch(shuffleTracks(data, ids))
|
||||
}, [dispatch, data, ids])
|
||||
|
||||
const handleAddToPlaylist = React.useCallback(() => {
|
||||
dispatch(openAddToPlaylist({ selectedIds: ids }))
|
||||
}, [dispatch, ids])
|
||||
|
||||
const handleDownload = React.useCallback(() => {
|
||||
subsonic.download(record.id)
|
||||
}, [record])
|
||||
@ -84,6 +95,12 @@ const AlbumActions = ({
|
||||
>
|
||||
<RiPlayListAddFill />
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleAddToPlaylist}
|
||||
label={translate('resources.album.actions.addToPlaylist')}
|
||||
>
|
||||
<PlaylistAddIcon />
|
||||
</Button>
|
||||
{config.enableDownloads && (
|
||||
<Button
|
||||
onClick={handleDownload}
|
||||
|
Loading…
x
Reference in New Issue
Block a user