From 755c5a846979387512e81a42d21280cf9dda9eed Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 31 Jan 2011 16:34:08 -0500 Subject: [PATCH] -fixed issue with unix pypo user not being assigned to groups -fixed issue with time being incorrect if server was in different timezone --- application/models/Schedule.php | 5 +++-- public/js/playlist/helperfunctions.js | 3 --- public/js/playlist/playlist.js | 3 +-- pypo/install/pypo-install.py | 5 ++--- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/application/models/Schedule.php b/application/models/Schedule.php index c42344fde..62bf121b2 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -472,10 +472,11 @@ class Schedule { } $timeNow = Schedule::GetSchedulerTime(); - return array("schedulerTime"=>$timeNow,"previous"=>Schedule::GetPreviousItems($timeNow), + return array("schedulerTime"=>gmdate("Y-m-d H:i:s"),"previous"=>Schedule::GetPreviousItems($timeNow), "current"=>Schedule::GetCurrentlyPlaying($timeNow), "next"=>Schedule::GetNextItems($timeNow), - "timezone"=> date("T")); + "timezone"=> date("T"), + "timezoneOffset"=> date("Z")); } public static function GetPreviousItems($timeNow, $prevCount = 1){ diff --git a/public/js/playlist/helperfunctions.js b/public/js/playlist/helperfunctions.js index c073515ff..62822cedf 100644 --- a/public/js/playlist/helperfunctions.js +++ b/public/js/playlist/helperfunctions.js @@ -72,9 +72,6 @@ function convertDateToHHMMSS(epochTime){ var hours = d.getUTCHours().toString(); var minutes = d.getUTCMinutes().toString(); var seconds = d.getUTCSeconds().toString(); - - //if (hours == "NaN") - //alert("epochTime: " + epochTime); if (hours.length == 1) hours = "0" + hours; diff --git a/public/js/playlist/playlist.js b/public/js/playlist/playlist.js index 77dc4cdf0..070327757 100644 --- a/public/js/playlist/playlist.js +++ b/public/js/playlist/playlist.js @@ -43,8 +43,6 @@ function getTrackInfo(song){ str += song.track_title; if (song.artist_name != null) str += " - " + song.artist_name; - //if (song.album_title != null) - //str += " - " + song.album_title; str += "," @@ -188,6 +186,7 @@ function calcAdditionalData(currentItem, bUpdateGlobalValues){ function parseItems(obj){ var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime); + schedulePosixTime += parseInt(obj.timezoneOffset)*1000; $('#time-zone').text(obj.timezone); diff --git a/pypo/install/pypo-install.py b/pypo/install/pypo-install.py index e82c2d314..3e94c06e0 100644 --- a/pypo/install/pypo-install.py +++ b/pypo/install/pypo-install.py @@ -35,9 +35,6 @@ def create_user(username): print "Creating user "+username os.system("adduser --system --quiet --group --shell /bin/bash "+username) - #add pypo to audio group - os.system("adduser " + username + " audio") - #set pypo password p = os.popen('/usr/bin/passwd pypo', 'w') p.write('pypo\n') @@ -45,6 +42,8 @@ def create_user(username): p.close() else: print "User already exists." + #add pypo to audio group + os.system("adduser " + username + " pulse-access 2>&1 1>/dev/null") def copy_dir(src_dir, dest_dir): if (os.path.exists(dest_dir)) and (dest_dir != "/"):