diff options
Diffstat (limited to 'app/client/modules/biggan/biggan.actions.js')
| -rw-r--r-- | app/client/modules/biggan/biggan.actions.js | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/app/client/modules/biggan/biggan.actions.js b/app/client/modules/biggan/biggan.actions.js index df78481..f09510c 100644 --- a/app/client/modules/biggan/biggan.actions.js +++ b/app/client/modules/biggan/biggan.actions.js @@ -155,7 +155,7 @@ export const load_directories = (id) => (dispatch) => { export const load_results = (id) => (dispatch) => { const module = bigganModule.name util.allProgress([ - actions.folder.index({ name: 'results' }), + actions.folder.index({ module, name: 'results' }), actions.file.index({ module, generated: 1, limit: 250 }), // actions.socket.list_directory({ module, dir: 'renders' }), // actions.socket.list_sequences({ module, dir: 'results' }), @@ -178,3 +178,38 @@ export const load_results = (id) => (dispatch) => { }) }) } + +export const load_encodings = () => dispatch => { + const module = bigganModule.name + util.allProgress([ + actions.folder.index({ module }), + actions.file.index({ + module, + datatype: 'image', + generated: 1, + }), + ], (folders, files) => { + console.log(folders, files) + const folder_name_lookup = {} + const encodings = {} + folders.forEach(folder => { + folder_name_lookup[folder.id] = folder.name + encodings[folder.name] = [] + }) + files.forEach(file => { + folder_name = folder_name_lookup[file.folder_id] + encodings[folder_name].push(file) + }) + folders.forEach(folder => { + if (!encodings[folder.name].length) { + delete encodings[folder_name] + } + }) + dispatch({ + type: types.biggan.load_encodings, + encodings + }) + + }) +} + |
