Enable transcoding of downlods (#1667)

* feat(download): Enable transcoding of downlods - #573

Signed-off-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>

* feat(download): Make automatic transcoding of downloads optional

Signed-off-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>

* Fix spelling

* address changes

* prettier

* fix config

* use previous name

Signed-off-by: Kendall Garner <17521368+kgarner7@users.noreply.github.com>
This commit is contained in:
Kendall Garner
2022-12-18 12:12:37 -05:00
committed by GitHub
parent 6489dd4478
commit 54395e7e6a
20 changed files with 421 additions and 72 deletions
+10 -4
View File
@@ -14,9 +14,15 @@ import CloudDownloadOutlinedIcon from '@material-ui/icons/CloudDownloadOutlined'
import { RiPlayListAddFill, RiPlayList2Fill } from 'react-icons/ri'
import QueueMusicIcon from '@material-ui/icons/QueueMusic'
import { httpClient } from '../dataProvider'
import { playNext, addTracks, playTracks, shuffleTracks } from '../actions'
import {
playNext,
addTracks,
playTracks,
shuffleTracks,
openDownloadMenu,
DOWNLOAD_MENU_PLAY,
} from '../actions'
import { M3U_MIME_TYPE, REST_URL } from '../consts'
import subsonic from '../subsonic'
import PropTypes from 'prop-types'
import { formatBytes } from '../utils'
import { useMediaQuery, makeStyles } from '@material-ui/core'
@@ -79,8 +85,8 @@ const PlaylistActions = ({ className, ids, data, record, ...rest }) => {
}, [getAllSongsAndDispatch])
const handleDownload = React.useCallback(() => {
subsonic.download(record.id)
}, [record])
dispatch(openDownloadMenu(record, DOWNLOAD_MENU_PLAY))
}, [dispatch, record])
const handleExport = React.useCallback(
() =>
+2
View File
@@ -31,6 +31,7 @@ import { AddToPlaylistDialog } from '../dialogs'
import { AlbumLinkField } from '../song/AlbumLinkField'
import { playTracks } from '../actions'
import PlaylistSongBulkActions from './PlaylistSongBulkActions'
import DownloadMenuDialog from '../dialogs/DownloadMenuDialog'
import ExpandInfoDialog from '../dialogs/ExpandInfoDialog'
const useStyles = makeStyles(
@@ -214,6 +215,7 @@ const PlaylistSongs = ({ playlistId, readOnly, actions, ...props }) => {
</Card>
</div>
<AddToPlaylistDialog />
<DownloadMenuDialog />
<ExpandInfoDialog content={<SongInfo />} />
{React.cloneElement(props.pagination, listContext)}
</>