Add Playlist action
This commit is contained in:
@@ -8,7 +8,7 @@ import PlayArrowIcon from '@material-ui/icons/PlayArrow'
|
||||
import ShuffleIcon from '@material-ui/icons/Shuffle'
|
||||
import React from 'react'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { playAlbum, shuffleAlbum } from '../audioplayer'
|
||||
import { playTracks, shuffleTracks } from '../audioplayer'
|
||||
|
||||
const AlbumActions = ({
|
||||
className,
|
||||
@@ -25,7 +25,7 @@ const AlbumActions = ({
|
||||
<TopToolbar className={className} {...sanitizeListRestProps(rest)}>
|
||||
<Button
|
||||
onClick={() => {
|
||||
dispatch(playAlbum(data, ids))
|
||||
dispatch(playTracks(data, ids))
|
||||
}}
|
||||
label={translate('resources.album.actions.playAll')}
|
||||
>
|
||||
@@ -33,7 +33,7 @@ const AlbumActions = ({
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
dispatch(shuffleAlbum(data, ids))
|
||||
dispatch(shuffleTracks(data, ids))
|
||||
}}
|
||||
label={translate('resources.album.actions.shuffle')}
|
||||
>
|
||||
|
||||
@@ -6,7 +6,7 @@ import MoreVertIcon from '@material-ui/icons/MoreVert'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import { useDataProvider, useNotify, useTranslate } from 'react-admin'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { addTracks, playAlbum, shuffleAlbum } from '../audioplayer'
|
||||
import { addTracks, playTracks, shuffleTracks } from '../audioplayer'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
icon: {
|
||||
@@ -25,7 +25,7 @@ const AlbumContextMenu = ({ record, color }) => {
|
||||
const options = {
|
||||
play: {
|
||||
label: translate('resources.album.actions.playAll'),
|
||||
action: (data) => playAlbum(data),
|
||||
action: (data) => playTracks(data),
|
||||
},
|
||||
addToQueue: {
|
||||
label: translate('resources.album.actions.addToQueue'),
|
||||
@@ -33,7 +33,7 @@ const AlbumContextMenu = ({ record, color }) => {
|
||||
},
|
||||
shuffle: {
|
||||
label: translate('resources.album.actions.shuffle'),
|
||||
action: (data) => shuffleAlbum(data),
|
||||
action: (data) => shuffleTracks(data),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import classnames from 'classnames'
|
||||
import { useDispatch } from 'react-redux'
|
||||
import { Card, useMediaQuery } from '@material-ui/core'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import { playAlbum } from '../audioplayer'
|
||||
import { playTracks } from '../audioplayer'
|
||||
import { DurationField, SongDetails, SongDatagridRow } from '../common'
|
||||
|
||||
const useStyles = makeStyles(
|
||||
@@ -124,7 +124,7 @@ const AlbumSongs = (props) => {
|
||||
) : (
|
||||
<SongsDatagrid
|
||||
expand={!isXsmall && <SongDetails />}
|
||||
rowClick={(id) => dispatch(playAlbum(data, ids, id))}
|
||||
rowClick={(id) => dispatch(playTracks(data, ids, id))}
|
||||
{...controllerProps}
|
||||
hasBulkActions={hasBulkActions}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user