Fix #132 Save Program not working at all.
This commit is contained in:
parent
885204a1bd
commit
e9fe6001e1
@ -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(
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -84,5 +84,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<plex-library height="300" visible="showPlexLibrary" on-finish="selectedCommercials"></plex-library>
|
||||
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user