Fixes OctoPrint.files.download method

This commit is contained in:
Gina Häußge 2015-09-28 18:41:40 +02:00
parent e57ed92294
commit bdc5d72613

View file

@ -23,7 +23,13 @@
return OctoPrint.issueCommand(url, command, data, opts);
};
var getFile = function(location, filename, opts) {
return OctoPrint.get(resourceForFile(location, filename), opts);
};
OctoPrint.files = {
get: getFile,
list: function (opts) {
return OctoPrint.get(url, opts);
},
@ -32,10 +38,6 @@
return OctoPrint.get(resourceForLocation(location), opts);
},
get: function (location, filename, opts) {
return OctoPrint.get(resourceForFile(location, filename), opts);
},
select: function (location, filename, print, opts) {
print = print || false;
@ -64,7 +66,7 @@
download: function (location, filename, opts) {
var deferred = $.Deferred();
exports.get(location, filename, opts)
getFile(location, filename, opts)
.done(function (response) {
OctoPrint.download(response.refs.download, opts)
.done(function () {