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
+49
View File
@@ -1,6 +1,12 @@
import {
ADD_TO_PLAYLIST_CLOSE,
ADD_TO_PLAYLIST_OPEN,
DOWNLOAD_MENU_ALBUM,
DOWNLOAD_MENU_ARTIST,
DOWNLOAD_MENU_CLOSE,
DOWNLOAD_MENU_OPEN,
DOWNLOAD_MENU_PLAY,
DOWNLOAD_MENU_SONG,
DUPLICATE_SONG_WARNING_OPEN,
DUPLICATE_SONG_WARNING_CLOSE,
EXTENDED_INFO_OPEN,
@@ -40,6 +46,49 @@ export const addToPlaylistDialogReducer = (
}
}
export const downloadMenuDialogReducer = (
previousState = {
open: false,
},
payload
) => {
const { type } = payload
switch (type) {
case DOWNLOAD_MENU_OPEN: {
switch (payload.recordType) {
case DOWNLOAD_MENU_ALBUM:
case DOWNLOAD_MENU_ARTIST:
case DOWNLOAD_MENU_PLAY:
case DOWNLOAD_MENU_SONG: {
return {
...previousState,
open: true,
record: payload.record,
recordType: payload.recordType,
}
}
default: {
return {
...previousState,
open: true,
record: payload.record,
recordType: undefined,
}
}
}
}
case DOWNLOAD_MENU_CLOSE: {
return {
...previousState,
open: false,
recordType: undefined,
}
}
default:
return previousState
}
}
export const expandInfoDialogReducer = (
previousState = {
open: false,