Skip to content

Commit

Permalink
Merge pull request #170 from colloqi/issue_168
Browse files Browse the repository at this point in the history
closes #168
  • Loading branch information
colloqi authored Oct 26, 2022
2 parents aa4d9e2 + fec89cb commit ea4df53
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions public/app/js/controllers/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,6 @@ angular.module('piGroups.controllers', [])


$scope.scheduleCalendar = function (playlist) {
var getHoursMinutes = function(timeString) {
var hhmmArray = timeString.split(':');
if (hhmmArray.length == 2)
return ({h:parseInt(hhmmArray[0]),m: parseInt(hhmmArray[1])});
else if (hhmmArray.length == 1)
return ({h:0,m: parseInt(hhmmArray[0])});
else if (hhmmArray.length > 2)
return ({h:parseInt(hhmmArray[hhmmArray.length -2]),m: parseInt(hhmmArray[hhmmArray.length -1])});
}

$scope.forPlaylist = playlist;
if (!$scope.forPlaylist.settings.weekdays &&
Expand Down Expand Up @@ -485,6 +476,15 @@ angular.module('piGroups.controllers', [])
$scope.scheduleCalendarModal.close();
}

function getHoursMinutes (timeString) {
var hhmmArray = timeString.split(':');
if (hhmmArray.length == 2)
return ({h:parseInt(hhmmArray[0]),m: parseInt(hhmmArray[1])});
else if (hhmmArray.length == 1)
return ({h:0,m: parseInt(hhmmArray[0])});
else if (hhmmArray.length > 2)
return ({h:parseInt(hhmmArray[hhmmArray.length -2]),m: parseInt(hhmmArray[hhmmArray.length -1])});
}
$scope.tempPopup;

$scope.displaySet = function () {
Expand Down Expand Up @@ -555,9 +555,6 @@ angular.module('piGroups.controllers', [])
$scope.saveSettings = function () {

$scope.group.selectedGroup = JSON.parse(JSON.stringify($scope.tempPopup));
$scope.tempPopup = {};

$scope.displayModal.close();
var minutes,hours;
var rebootMinutes, rebootHours;
if ($scope.tempPopup.sleep && $scope.tempPopup.sleep.ontimeObj) {
Expand All @@ -570,7 +567,7 @@ angular.module('piGroups.controllers', [])
hours = $scope.tempPopup.sleep.offtimeObj.getHours()
$scope.group.selectedGroup.sleep.offtime = (hours < 10)?("0"+hours):(""+hours);
minutes = $scope.tempPopup.sleep.offtimeObj.getMinutes();
$scope.group.selectedGroup.offtime += (minutes < 10)?(":0"+minutes):":"+minutes;
$scope.group.selectedGroup.sleep.offtime += (minutes < 10)?(":0"+minutes):":"+minutes;
}

if($scope.tempPopup.reboot && $scope.tempPopup.reboot.time){
Expand Down Expand Up @@ -605,6 +602,8 @@ angular.module('piGroups.controllers', [])

$scope.group.selectedGroup.enableMpv = $scope.group.selectedGroup.selectedVideoPlayer === "mpv"
$scope.updateGroup();
$scope.tempPopup = {};
$scope.displayModal.close();
}

$scope.groupTicker = function() {
Expand Down

0 comments on commit ea4df53

Please sign in to comment.