summaryrefslogtreecommitdiff
path: root/app/client/modules
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/modules')
-rw-r--r--app/client/modules/samplernn/samplernn.datasets.js5
-rw-r--r--app/client/modules/samplernn/samplernn.reducer.js37
2 files changed, 1 insertions, 41 deletions
diff --git a/app/client/modules/samplernn/samplernn.datasets.js b/app/client/modules/samplernn/samplernn.datasets.js
index 9ee7618..607f041 100644
--- a/app/client/modules/samplernn/samplernn.datasets.js
+++ b/app/client/modules/samplernn/samplernn.datasets.js
@@ -11,10 +11,7 @@ import NewDatasetForm from '../../dataset/dataset.new'
import { FileList, FileRow } from '../../common/fileList.component'
import Loading from '../../common/loading.component'
-const samplernnModule = {
- name: 'samplernn',
- datatype: 'audio',
-}
+import samplernnModule from './samplernn.module'
class SampleRNNDatasets extends Component {
constructor(props){
diff --git a/app/client/modules/samplernn/samplernn.reducer.js b/app/client/modules/samplernn/samplernn.reducer.js
index 1397a0b..c1dee82 100644
--- a/app/client/modules/samplernn/samplernn.reducer.js
+++ b/app/client/modules/samplernn/samplernn.reducer.js
@@ -19,24 +19,6 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
loading: false,
data: action.data,
}
-
- case types.socket.connect:
- return {
- ...state,
- }
-
- case types.task.task_begin:
- return {
- ...state,
- }
-
- case types.task.task_finish:
- return {
- ...state,
- }
-
- // so now the last thing is to figure out how to access things inside these datasets
- // and rebuild them if need be, considering this is SUPER awkward inside of redux.
case types.folder.create:
if (action.data.module === 'samplernn') {
@@ -123,7 +105,6 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
return state
case types.file.update:
- console.log('>>>>>>> file update')
if (action.data.module === 'samplernn') {
let old_dataset;
let new_dataset = state.data.datasetLookup[action.data.dataset]
@@ -169,7 +150,6 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
return state
case types.file.destroy:
- console.log(action.data)
if (action.data.module === 'samplernn') {
// delete the key from fileLookup
let fileLookup = {
@@ -185,16 +165,13 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
if (!old_file) return state
let old_dataset = state.data.datasetLookup[old_file.dataset]
let dataset
- console.log(old_file.dataset, old_dataset)
if (old_dataset) {
dataset = {
...old_dataset,
input: old_dataset.input.filter(id => id !== old_file.id),
output: old_dataset.output.filter(id => id !== old_file.id),
}
- console.log(dataset.input.length, dataset.checkpoints.length, dataset.output.length)
if (! dataset.input.length && ! dataset.checkpoints.length && ! dataset.output.length) {
- console.log('dataset is empty')
delete datasetLookup[old_file.dataset]
let old_folder = folderLookup[old_file.folder_id]
folderLookup[old_file.folder_id] = {
@@ -207,7 +184,6 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
}
}
delete fileLookup[old_file.id]
- // console.log(fileLookup)
return {
...state,
@@ -222,9 +198,6 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
}
return state
- case types.socket.status:
- return samplernnSocket(state, action.data)
-
case types.samplernn.set_folder:
return {
...state,
@@ -248,14 +221,4 @@ const samplernnReducer = (state = samplernnInitialState, action) => {
}
}
-const samplernnSocket = (state, action) => {
- console.log(action)
- switch (action.key) {
- case 'list_directory':
- return state
- default:
- return state
- }
-}
-
export default samplernnReducer