From 85c27fd442b311effd736928ada879180208c9ae Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Tue, 1 Dec 2015 23:45:12 +0100 Subject: jingle: set cut description to filename diff --git a/www/js/jingles.js b/www/js/jingles.js index 13df2bf..6a1f114 100644 --- a/www/js/jingles.js +++ b/www/js/jingles.js @@ -450,9 +450,8 @@ Importer.prototype.importFileUploadError = function(dz, file, msg, xhr) { }; Importer.prototype.importAddCut = function(dz, file) { - // todo: set additional parameters like DESCRIPTION here, when patch has been applied. var cart = this.currentGroup.mainCart; - rivendell.addCut(cart.number, function(cutXml) { + rivendell.addCut(cart.number, file.name, function(cutXml) { var cutNumber = $(cutXml).find('cutNumber').text(); dz.on('sending', function(file, xhr, formData) { formData.append('COMMAND', 2); diff --git a/www/js/rivendell.rh.js b/www/js/rivendell.rh.js index 04897b0..72cdf9f 100644 --- a/www/js/rivendell.rh.js +++ b/www/js/rivendell.rh.js @@ -33,3 +33,14 @@ Rivendell.Rivendell.prototype.listDropboxes = function(success) { }; return $.post(this.listDropboxesEndpoint, command, success, 'xml'); }; + +Rivendell.Rivendell.prototype.addCut = function(cartNumber, filename, success) { + var command = { + COMMAND: 10, + LOGIN_NAME: this.username, + PASSWORD: this.token, + CART_NUMBER: cartNumber, + DESCRIPTION: filename + }; + return $.post(this.rdxportEndpoint, command, success, 'xml'); +}; -- cgit v0.10.2