summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-07-15 15:20:09 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-07-15 15:20:09 (GMT)
commita3d0413c9c77e24254a3280dce17c6672a2b8cc3 (patch)
tree30337b41dbd40bf447a5e95cd37c5d7ad30a957f
parent355b9109410ddbb2a471d88b0eadcdc895032aac (diff)
fix useMetadata, set SHOW_ID
-rw-r--r--www/js/importer.js16
-rw-r--r--www/js/shows.js4
2 files changed, 10 insertions, 10 deletions
diff --git a/www/js/importer.js b/www/js/importer.js
index 8fae084..cbea665 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -131,7 +131,7 @@ Rdxport.Importer.prototype.resetModal = function() {
$('#uploadModal-confirm', this.$el).attr('disabled','disabled').off('click');
};
-Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, newCartNumber, useMetadata) {
+Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, useMetadata) {
this.resetModal();
var $drop = $('.modal-body .drop', this.$el);
var $form = $('form', $drop);
@@ -247,8 +247,7 @@ Rdxport.Importer.prototype.getUploadByCartNumber = function(cartNumber) {
}
var upload = null;
$.each(this.uploads, function(index, currentUpload) {
- if (currentUpload.cartNumber === cartNumber ||
- currentUpload.newCartNumber === cartNumber) {
+ if (currentUpload.cartNumber === cartNumber) {
upload = currentUpload;
return false; //break;
}
@@ -275,8 +274,7 @@ Rdxport.Importer.prototype.getUploadsByCartNumber = function(cartNumber) {
return null;
}
return this.uploads.filter(function (currentUpload) {
- return currentUpload.cartNumber === cartNumber ||
- currentUpload.newCartNumber === cartNumber;
+ return currentUpload.cartNumber === cartNumber;
});
};
@@ -306,7 +304,6 @@ Rdxport.Upload = function(fileOrsourceUri, group, groupView, cartNumber, useMeta
this.group = group;
this.groupView = groupView;
this.cartNumber = cartNumber;
- this.newCartNumber = null;
this.useMetadata = useMetadata;
this.uploadId = null;
@@ -336,7 +333,7 @@ Rdxport.Upload.prototype.onerror = function(error) {
console.log(error);
var file = {
- cartNumber: this.cartNumber || this.newCartNumber
+ cartNumber: this.cartNumber
};
this.importFileUploadError(file, 500, error);
};
@@ -345,7 +342,7 @@ Rdxport.Upload.prototype.onmessage = function(event) {
var data = $.parseJSON(event.data);
this.uploadId = data.ID;
var file = {
- cartNumber: this.cartNumber || this.newCartNumber
+ cartNumber: this.cartNumber
};
switch (data.TYPE.toLowerCase()) {
case Rdxport.Importer.TYPE_ERROR:
@@ -417,6 +414,9 @@ Rdxport.Upload.prototype.import = function() {
AUTOTRIM_LEVEL: self.group.trimlevel,
USE_METADATA: self.useMetadata
};
+ if (self.group instanceof Rdxport.Show) {
+ sendOptions.SHOW_ID = self.group.id;
+ }
if (self.cartNumber) {
sendOptions.REFERENCE_ID = self.group.groupName + '/' + self.cartNumber + '/' + self.filename;
sendOptions.CART_NUMBER = parseInt(self.cartNumber);
diff --git a/www/js/shows.js b/www/js/shows.js
index 30dbd8e..82e38b5 100644
--- a/www/js/shows.js
+++ b/www/js/shows.js
@@ -83,7 +83,7 @@ Rdxport.ShowListView.prototype.getCurrentShowView = function() {
var self = this;
var showViewFound = null;
$(this.showViews).each(function(index, showView) {
- if (showView.model.id === self.currentShowId) {
+ if (showView.model.id === parseInt(self.currentShowId)) {
showViewFound = showView;
return true;
}
@@ -147,7 +147,7 @@ Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, tr
id, title, log, rhythm, dayofweek, starttime, length) {
if (arguments.length = 1) {
Rdxport.Group.call(this, groupName);
- this.id = $('show-id', this.xml).text();
+ this.id = parseInt($('show-id', this.xml).text());
this.title = $('show-title', this.xml).text();
this.log = $('show-log', this.xml).text();
this.rhythm = $('show-rhythm', this.xml).text();