From 8d06839056967e8786c63976545aff098ae2f128 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 26 Jun 2018 01:28:41 +0200 Subject: morph module.. enum method for sliders --- app/client/modules/morph/morph.actions.js | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 app/client/modules/morph/morph.actions.js (limited to 'app/client/modules/morph/morph.actions.js') 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 -- cgit v1.2.3-70-g09d2