Fix slowness when adding filler when there are a lot of fillers in the list.

This commit is contained in:
vexorian 2020-09-17 20:15:39 -04:00
parent a81cf78f5c
commit 4bfef9fd38
2 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,9 @@ module.exports = function ($timeout) {
scope.onDone(JSON.parse(angular.toJson(prog)))
scope.program = null
}
scope.showList = () => {
return ! scope.showPlexLibrary && ! scope.showFallbackPlexLibrary;
}
scope.sortFillers = () => {
scope.program.filler.sort( (a,b) => { return a.duration - b.duration } );
}
@ -60,6 +63,7 @@ module.exports = function ($timeout) {
selectedPrograms[i].commercials = []
}
scope.program.filler = scope.program.filler.concat(selectedPrograms);
scope.showPlexLibrary = false;
}
scope.importFallback = (selectedPrograms) => {
@ -70,6 +74,7 @@ module.exports = function ($timeout) {
if (selectedPrograms.length > 0) {
scope.program.fallback = [ selectedPrograms[0] ];
}
scope.showFallbackPlexLibrary = false;
}

View File

@ -138,7 +138,7 @@
<div ng-show="program.filler.length === 0">
<p class="text-center text-info">Click the <span class="fa fa-plus"></span> to import filler content from your Plex server(s).</p>
</div>
<div class="list-group list-group-root" dnd-list="program.filler">
<div class="list-group list-group-root" dnd-list="program.filler" ng-if="showList()">
<div class="list-group-item flex-container" style="cursor: default;" ng-repeat="x in program.filler" dnd-draggable="x" dnd-moved="program.filler.splice($index, 1)" dnd-effect-allowed="move">
<div class="program-start" >
{{durationString(x.duration)}}