diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-26 01:28:41 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-26 01:28:41 +0200 |
| commit | 8d06839056967e8786c63976545aff098ae2f128 (patch) | |
| tree | 51c83236b2dcc5a6adabb1b4036eccfff63b9ef5 /app/client/modules/morph/morph.actions.js | |
| parent | bd354556f98aa724dd6cee03a1828bd40ce01f33 (diff) | |
morph module.. enum method for sliders
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 |
