[ARVADOS] updated: 28cb528637cb4326def40d07d349108acce3d383

git at public.curoverse.com git at public.curoverse.com
Tue Dec 9 03:02:01 EST 2014


Summary of changes:
 .../app/assets/javascripts/upload_to_collection.js         | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

       via  28cb528637cb4326def40d07d349108acce3d383 (commit)
      from  2d5c3de5600cd820e783a27e5d9ebceb6847f9c1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 28cb528637cb4326def40d07d349108acce3d383
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Dec 9 03:02:15 2014 -0500

    3781: Fix progress% (100, not NaN) and manifest format (>=1 data locator) for zero-byte files.

diff --git a/apps/workbench/app/assets/javascripts/upload_to_collection.js b/apps/workbench/app/assets/javascripts/upload_to_collection.js
index 4fc24a2..acdcb24 100644
--- a/apps/workbench/app/assets/javascripts/upload_to_collection.js
+++ b/apps/workbench/app/assets/javascripts/upload_to_collection.js
@@ -283,7 +283,10 @@ function UploadToCollection($scope, $filter, $q, $timeout,
         }
         function setProgress(bytesDone) {
             var kBps;
-            that.progress = Math.min(100, 100 * bytesDone / that.file.size)
+            if (that.file.size == 0)
+                that.progress = 100;
+            else
+                that.progress = Math.min(100, 100 * bytesDone / that.file.size);
             if (bytesDone > _startByte) {
                 kBps = (bytesDone - _startByte) /
                     (Date.now() - _startTime);
@@ -422,11 +425,18 @@ function UploadToCollection($scope, $filter, $q, $timeout,
                 then(function(collection) {
                     var manifestText = '';
                     $.each(uploads, function(_, upload) {
+                        var locators = upload.locators;
+                        if (locators.length === 0) {
+                            // Every stream must have at least one
+                            // data locator, even if it is zero bytes
+                            // long:
+                            locators = ['d41d8cd98f00b204e9800998ecf8427e+0'];
+                        }
                         filename = ArvadosClient.uniqueNameForManifest(
                             collection.manifest_text,
                             '.', upload.file.name);
                         collection.manifest_text += '. ' +
-                            upload.locators.join(' ') +
+                            locators.join(' ') +
                             ' 0:' + upload.file.size.toString() + ':' +
                             filename +
                             '\n';

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list