summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Grassberger <petertheone@gmail.com>2016-07-15 14:55:05 (GMT)
committerPeter Grassberger <petertheone@gmail.com>2016-07-15 14:55:05 (GMT)
commit355b9109410ddbb2a471d88b0eadcdc895032aac (patch)
treed4befaf2875be7cd30d2810167683af682b968fd
parent8950c5830665de3c20a0d142f69f8bd33ef74183 (diff)
remove unused newCartNumber, send normalization and autotrim levels
-rw-r--r--www/js/importer.js20
-rw-r--r--www/js/jingles.js2
-rw-r--r--www/js/musicpools.js2
-rw-r--r--www/js/rdxport.js8
-rw-r--r--www/js/shows.js6
5 files changed, 16 insertions, 22 deletions
diff --git a/www/js/importer.js b/www/js/importer.js
index c813f1a..8fae084 100644
--- a/www/js/importer.js
+++ b/www/js/importer.js
@@ -172,7 +172,7 @@ Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, ne
$('div.modal-body .drop', self.$el).css("background-image", "url('/img/audio_file.png')");
$('.modal-body #sourceUri', self.$el).val('');
$('#uploadModal-confirm', self.$el).off('click').on('click', function() {
- var upload = new Rdxport.Upload(file, group, groupView, cartNumber, newCartNumber, useMetadata);
+ var upload = new Rdxport.Upload(file, group, groupView, cartNumber, useMetadata);
upload.import();
self.uploads.push(upload);
@@ -191,7 +191,7 @@ Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, ne
$('.modal-body .drop form input[type="file"]', this.$el).val('');
$('#uploadModal-confirm', self.$el).off('click').on('click', function() {
var sourceUri = $('.modal-body #sourceUri', self.$el).val();
- var upload = new Rdxport.Upload(sourceUri, group, groupView, cartNumber, newCartNumber, useMetadata);
+ var upload = new Rdxport.Upload(sourceUri, group, groupView, cartNumber, useMetadata);
upload.import();
self.uploads.push(upload);
@@ -289,7 +289,7 @@ Rdxport.Importer.prototype.getUploadsByGroupName = function(groupName) {
});
};
-Rdxport.Upload = function(fileOrsourceUri, group, groupView, cartNumber, newCartNumber, useMetadata) {
+Rdxport.Upload = function(fileOrsourceUri, group, groupView, cartNumber, useMetadata) {
this.sourceUri = '';
this.file = null;
this.filename = '';
@@ -306,7 +306,7 @@ Rdxport.Upload = function(fileOrsourceUri, group, groupView, cartNumber, newCart
this.group = group;
this.groupView = groupView;
this.cartNumber = cartNumber;
- this.newCartNumber = newCartNumber;
+ this.newCartNumber = null;
this.useMetadata = useMetadata;
this.uploadId = null;
@@ -413,22 +413,16 @@ Rdxport.Upload.prototype.import = function() {
TIMEOUT: 7200, // 2 hours
SOURCE_URI: self.sourceUri,
CHANNELS: 2,
- // todo: is this needed?
- //NORMALIZATION_LEVEL: self.cart.normlevel,
- //AUTOTRIM_LEVEL: self.cart.trimlevel,
+ NORMALIZATION_LEVEL: self.group.normlevel,
+ AUTOTRIM_LEVEL: self.group.trimlevel,
USE_METADATA: self.useMetadata
};
if (self.cartNumber) {
sendOptions.REFERENCE_ID = self.group.groupName + '/' + self.cartNumber + '/' + self.filename;
sendOptions.CART_NUMBER = parseInt(self.cartNumber);
- } else {
- if (self.newCartNumber) {
- sendOptions.REFERENCE_ID = self.group.groupName + '/' + self.newCartNumber + '/' + self.filename;
- sendOptions.CART_NUMBER = parseInt(self.newCartNumber);
- } else if (self.group instanceof Rdxport.Musicpool) {
+ } else if (self.group instanceof Rdxport.Musicpool) {
sendOptions.REFERENCE_ID = self.group.groupName + '/' + '/' + self.filename;
sendOptions.MUSIC_POOL_GROUP = self.group.groupName;
- }
}
console.log(sendOptions);
this.send(JSON.stringify(sendOptions));
diff --git a/www/js/jingles.js b/www/js/jingles.js
index eeb3927..04ae087 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -108,7 +108,7 @@ Rdxport.JingleGroupView.prototype.render = function() {
$('table tbody tr', this.$el).remove();
$('.uploadButton', this.$el).on('click', function() {
- importer.openModal(self.model, self, self.model.carts[0].number, null, false);
+ importer.openModal(self.model, self, self.model.carts[0].number, false);
});
};
diff --git a/www/js/musicpools.js b/www/js/musicpools.js
index e3a9118..d96d537 100644
--- a/www/js/musicpools.js
+++ b/www/js/musicpools.js
@@ -183,7 +183,7 @@ Rdxport.MusicpoolView.prototype.render = function() {
$('.uploadButton', this.$el).on('click', function() {
- importer.openModal(self.model, self, null, null, true);
+ importer.openModal(self.model, self, null, true);
});
};
diff --git a/www/js/rdxport.js b/www/js/rdxport.js
index ff54f51..e698493 100644
--- a/www/js/rdxport.js
+++ b/www/js/rdxport.js
@@ -363,10 +363,10 @@ Rdxport.Group = function(groupName, description, lowcart, highcart, normlevel, t
this.xml = arguments[0];
this.groupName = $('group', this.xml).text();
this.description = $('group-description', this.xml).text();
- this.lowcart = $('group-low-cart', this.xml).text();
- this.highcart = $('group-high-cart', this.xml).text();
- this.normlevel = $('normalization-level', this.xml).text();
- this.trimlevel = $('autotrim-level', this.xml).text();
+ this.lowcart = parseInt($('group-low-cart', this.xml).text());
+ this.highcart = parseInt($('group-high-cart', this.xml).text());
+ this.normlevel = parseInt($('normalization-level', this.xml).text());
+ this.trimlevel = parseInt($('autotrim-level', this.xml).text());
} else {
this.groupName = groupName;
this.description = description;
diff --git a/www/js/shows.js b/www/js/shows.js
index fb54ea5..30dbd8e 100644
--- a/www/js/shows.js
+++ b/www/js/shows.js
@@ -151,9 +151,9 @@ Rdxport.Show = function(groupName, description, lowcart, highcart, normlevel, tr
this.title = $('show-title', this.xml).text();
this.log = $('show-log', this.xml).text();
this.rhythm = $('show-rhythm', this.xml).text();
- this.dayofweek = $('show-dayofweek', this.xml).text();
+ this.dayofweek = parseInt($('show-dayofweek', this.xml).text());
this.starttime = $('show-starttime', this.xml).text();
- this.length = $('show-length', this.xml).text();
+ this.length = parseInt($('show-length', this.xml).text());
} else {
Rdxport.Group.call(this, groupName, description, lowcart, highcart, normlevel, trimlevel);
this.id = id;
@@ -368,7 +368,7 @@ Rdxport.ShowCartView.renderEmpty = function(group, groupView, cartNumber) {
var $uploadButton = $('<button class="uploadButton btn btn-primary btn-xs"><span class="glyphicon glyphicon-upload"></span>&nbsp;&nbsp;Importieren</button>');
$uploadButton.off('click').on('click', function() {
- importer.openModal(group, groupView, cartNumber, null, true);
+ importer.openModal(group, groupView, cartNumber, true);
});
return $('<tr>')