equal
deleted
inserted
replaced
76 dl_themes: function(commandOptions) { |
76 dl_themes: function(commandOptions) { |
77 return this.dl_countmap(commandOptions, 'themes'); |
77 return this.dl_countmap(commandOptions, 'themes'); |
78 }, |
78 }, |
79 dl_documents_ids: function(commandOptions, rawArgs, ui) { |
79 dl_documents_ids: function(commandOptions, rawArgs, ui) { |
80 |
80 |
81 var nextPageUrl = commandOptions.url; |
81 var nextPageUrl = commandOptions.url+"?sort=_graph"; |
82 var pageIndex = 1; |
82 var pageIndex = 1; |
83 var ids = commandOptions.extra?_.map(commandOptions.extra.split(','), function(id) { return { id: id};}):[]; |
83 var ids = commandOptions.extra?_.map(commandOptions.extra.split(','), function(id) { return { id: id};}):[]; |
84 |
84 |
85 return promiseWhile( |
85 return promiseWhile( |
86 function() { return pageIndex <= commandOptions.page && nextPageUrl; }, |
86 function() { return pageIndex <= commandOptions.page && nextPageUrl; }, |
94 } else if (res.statusCode !== 200) { |
94 } else if (res.statusCode !== 200) { |
95 err = new Error('Unexpected status code: ' + res.statusCode); |
95 err = new Error('Unexpected status code: ' + res.statusCode); |
96 err.res = res; |
96 err.res = res; |
97 return deferred.reject(err); |
97 return deferred.reject(err); |
98 } |
98 } |
99 nextPageUrl = body.next_page_url; |
99 nextPageUrl = body.meta.next_page_url; |
100 pageIndex++; |
100 pageIndex++; |
101 |
101 |
102 ids = _.reduce( |
102 ids = _.reduce( |
103 body.documents, |
103 body.documents, |
104 function(res, doc) { |
104 function(res, doc) { |