Skip to content

Commit

Permalink
feat(export): changed folder names for each step
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Mar 1, 2020
1 parent 94c2d7e commit ad02426
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/app/modals/download-modal/download-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,20 +330,22 @@ export class DownloadModalComponent implements OnInit, OnChanges {
for (let j = 1; j < task.operations.length; j++) {
const operation = task.operations[j];

console.log(operation.name);
if (operation.name !== task.operations[0].name && operation.state === TaskState.FINISHED && operation.results.length > 0) {
const opResult = operation.lastResult;

const folderName = this.getFolderName(operation);
entryResult.push({
path: `${task.files[0].name}/${operation.name}/${opResult.file.name}`,
path: `${task.files[0].name}/${folderName}/${opResult.file.name}`,
file: opResult.file
});


promises.push(new Promise<void>((resolve2, reject2) => {
this.getConversionFiles(operation).then((entries) => {
const folderName2 = this.getFolderName(operation);
for (const entry of entries) {
entryResult.push({
path: `${task.files[0].name}/${operation.name}/${entry.fullname}`,
path: `${task.files[0].name}/${folderName2}/${entry.fullname}`,
file: entry.file
});
resolve2();
Expand Down Expand Up @@ -388,4 +390,17 @@ export class DownloadModalComponent implements OnInit, OnChanges {
this.taskService.taskList.removeEntry(entry, true);
}
}

getFolderName(operation: Operation) {
switch (operation.name) {
case ('ASR'):
return '1_Speech Recognition';
case ('OCTRA'):
return '2_Manual Transcription';
case ('MAUS'):
return '3_Word Alignment';
case ('Emu WebApp'):
return '4_Phonetic Detail';
}
}
}

0 comments on commit ad02426

Please sign in to comment.