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
+13 -2
View File
@@ -14,9 +14,11 @@ import {
playTracks,
shuffleTracks,
openAddToPlaylist,
openDownloadMenu,
openExtendedInfoDialog,
DOWNLOAD_MENU_ALBUM,
DOWNLOAD_MENU_ARTIST,
} from '../actions'
import subsonic from '../subsonic'
import { LoveButton } from './LoveButton'
import config from '../config'
import { formatBytes } from '../utils'
@@ -83,7 +85,16 @@ const ContextMenu = ({
label: `${translate('resources.album.actions.download')} (${formatBytes(
record.size
)})`,
action: () => subsonic.download(record.id),
action: () => {
dispatch(
openDownloadMenu(
record,
record.duration !== undefined
? DOWNLOAD_MENU_ALBUM
: DOWNLOAD_MENU_ARTIST
)
)
},
},
...(!hideInfo && {
info: {
+5 -2
View File
@@ -12,8 +12,9 @@ import {
setTrack,
openAddToPlaylist,
openExtendedInfoDialog,
openDownloadMenu,
DOWNLOAD_MENU_SONG,
} from '../actions'
import subsonic from '../subsonic'
import { LoveButton } from './LoveButton'
import config from '../config'
import { formatBytes } from '../utils'
@@ -67,7 +68,9 @@ export const SongContextMenu = ({
label: `${translate('resources.song.actions.download')} (${formatBytes(
record.size
)})`,
action: (record) => subsonic.download(record.mediaFileId || record.id),
action: (record) => {
dispatch(openDownloadMenu(record, DOWNLOAD_MENU_SONG))
},
},
info: {
enabled: true,