Преглед на файлове

Transloadit: fix receiving results not associated with an uploaded file, closes #200 (#201)

Results that aren't related to an uploaded file will just get a `localId == null`.

* Transloadit: fix receiving results not associated with an uploaded file, closes #200

* Transloadit: Fix retrieving final assembly status.

* Transloadit: *Do* process results that did not come from uploaded files.
Renée Kooi преди 8 години
родител
ревизия
5a0e8ee2b0
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      src/plugins/Transloadit/index.js

+ 4 - 2
src/plugins/Transloadit/index.js

@@ -155,7 +155,9 @@ module.exports = class Transloadit extends Plugin {
 
 
   onResult (stepName, result) {
   onResult (stepName, result) {
     const file = this.state.files[result.original_id]
     const file = this.state.files[result.original_id]
-    result.localId = file.id
+    // The `file` may not exist if an import robot was used instead of a file upload.
+    result.localId = file ? file.id : null
+
     this.updateState({
     this.updateState({
       results: this.state.results.concat(result)
       results: this.state.results.concat(result)
     })
     })
@@ -208,7 +210,7 @@ module.exports = class Transloadit extends Plugin {
 
 
     this.core.emit('informer', this.opts.locale.strings.encoding, 'info', 0)
     this.core.emit('informer', this.opts.locale.strings.encoding, 'info', 0)
     return this.assemblyReady.then(() => {
     return this.assemblyReady.then(() => {
-      return this.client.getAssemblyStatus(this.state.assembly.status_endpoint)
+      return this.client.getAssemblyStatus(this.state.assembly.assembly_ssl_url)
     }).then((assembly) => {
     }).then((assembly) => {
       this.updateState({ assembly })
       this.updateState({ assembly })