diff --git a/web/directives/channel-config.js b/web/directives/channel-config.js index 8734685..8a2f0ec 100644 --- a/web/directives/channel-config.js +++ b/web/directives/channel-config.js @@ -1080,8 +1080,9 @@ module.exports = function ($timeout, $location, dizquetv) { } scope.importPrograms = (selectedPrograms) => { - for (let i = 0, l = selectedPrograms.length; i < l; i++) - selectedPrograms[i].commercials = [] + for (let i = 0, l = selectedPrograms.length; i < l; i++) { + delete selectedPrograms[i].commercials; + } scope.channel.programs = scope.channel.programs.concat(selectedPrograms) updateChannelDuration() setTimeout( diff --git a/web/directives/program-config.js b/web/directives/program-config.js index ce50987..f274eb5 100644 --- a/web/directives/program-config.js +++ b/web/directives/program-config.js @@ -9,13 +9,6 @@ module.exports = function ($timeout) { onDone: "=onDone" }, link: function (scope, element, attrs) { - scope.selectedCommercials = (items) => { - scope.program.commercials = scope.program.commercials.concat(items) - for (let i = 0, l = scope.program.commercials.length; i < l; i++) { - if (typeof scope.program.commercials[i].commercialPosition === 'undefined') - scope.program.commercials[i].commercialPosition = 0 - } - } scope.finished = (prog) => { if (prog.title === "") scope.error = { title: 'You must set a program title.' } @@ -37,9 +30,6 @@ module.exports = function ($timeout) { return } - prog.duration = prog.duration - for (let i = 0, l = prog.commercials.length; i < l; i++) - prog.duration += prog.commercials[i].duration scope.onDone(JSON.parse(angular.toJson(prog))) scope.program = null } diff --git a/web/public/templates/program-config.html b/web/public/templates/program-config.html index 3577ea7..ce48dab 100644 --- a/web/public/templates/program-config.html +++ b/web/public/templates/program-config.html @@ -84,5 +84,5 @@ - + \ No newline at end of file