diff options
Diffstat (limited to 'app/relay/modules/pix2pix.js')
| -rw-r--r-- | app/relay/modules/pix2pix.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/app/relay/modules/pix2pix.js b/app/relay/modules/pix2pix.js index 97533d4..61c0032 100644 --- a/app/relay/modules/pix2pix.js +++ b/app/relay/modules/pix2pix.js @@ -20,17 +20,20 @@ const fetch = { console.log(task) return [ task.module, task.opt.url ] }, - listen: (task, line, i) => { + listen: (task, res, i) => { // relay the new dataset name from youtube-dl or w/e - if ( line.match(/^created dataset: /) ) { - console.log("_______________________________________-") - console.log("_______________________________________-") - console.log("_______________________________________-") - let filename = line.split(': ')[1].trim() - task.dataset = filename.split('.')[0] - task.opt.filename = filename - console.log(">>>>>> created dataset", filename) - return { type: 'progress', action: 'resolve_dataset', task } + const lines = res.split('\n') + for (let line of lines) { + if ( line.match(/^created dataset: /) ) { + console.log("_______________________________________-") + console.log("_______________________________________-") + console.log("_______________________________________-") + let filename = line.split(': ')[1].trim() + task.dataset = filename.split('.')[0] + task.opt.filename = filename + console.log(">>>>>> created dataset", filename) + return { type: 'progress', action: 'resolve_dataset', task } + } } return null }, |
