diff options
Diffstat (limited to 'app/client/modules/morph/morph.actions.js')
| -rw-r--r-- | app/client/modules/morph/morph.actions.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/app/client/modules/morph/morph.actions.js b/app/client/modules/morph/morph.actions.js new file mode 100644 index 0000000..9d47d03 --- /dev/null +++ b/app/client/modules/morph/morph.actions.js @@ -0,0 +1,45 @@ +import uuidv1 from 'uuid/v1' + +import socket from '../../socket' +import types from '../../types' + +import * as datasetLoader from '../../dataset/dataset.loader' + +import actions from '../../actions' + +import util from '../../util' + +import morphModule from './morph.module' + +export const load_data = (id) => (dispatch) => { + const module = morphModule.name + util.allProgress([ + datasetLoader.load(module), + actions.socket.list_sequences({ module: 'pix2pixhd', dir: 'sequences' }), + actions.socket.list_directory({ module, dir: 'renders' }), + ], (percent, i, n) => { + console.log('morph load progress', i, n) + dispatch({ type: types.app.load_progress, progress: { i, n }}) + }).then(res => { + const [datasetApiReport, sequences, renders] = res + const { + folderLookup, + fileLookup, + datasetLookup, + folders, + files, + unsortedFolder, + resultsFolder, + } = datasetApiReport + + dispatch({ + type: types.morph.load, + data: datasetApiReport, + app: { + files, + sequences, + renders, + } + }) + }) +}
\ No newline at end of file |
