From 72485efe1d7e17c883beba80c7a6b65ff1dca841 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 16 Jun 2018 19:05:45 +0200 Subject: deploy bundle --- app/relay/modules/pix2pix.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'app/relay/modules/pix2pix.js') 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 }, -- cgit v1.2.3-70-g09d2