-fixed issue with unix pypo user not being assigned to groups
-fixed issue with time being incorrect if server was in different timezone
This commit is contained in:
parent
7751ad7ac7
commit
755c5a8469
|
@ -472,10 +472,11 @@ class Schedule {
|
||||||
}
|
}
|
||||||
|
|
||||||
$timeNow = Schedule::GetSchedulerTime();
|
$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),
|
"current"=>Schedule::GetCurrentlyPlaying($timeNow),
|
||||||
"next"=>Schedule::GetNextItems($timeNow),
|
"next"=>Schedule::GetNextItems($timeNow),
|
||||||
"timezone"=> date("T"));
|
"timezone"=> date("T"),
|
||||||
|
"timezoneOffset"=> date("Z"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetPreviousItems($timeNow, $prevCount = 1){
|
public static function GetPreviousItems($timeNow, $prevCount = 1){
|
||||||
|
|
|
@ -72,9 +72,6 @@ function convertDateToHHMMSS(epochTime){
|
||||||
var hours = d.getUTCHours().toString();
|
var hours = d.getUTCHours().toString();
|
||||||
var minutes = d.getUTCMinutes().toString();
|
var minutes = d.getUTCMinutes().toString();
|
||||||
var seconds = d.getUTCSeconds().toString();
|
var seconds = d.getUTCSeconds().toString();
|
||||||
|
|
||||||
//if (hours == "NaN")
|
|
||||||
//alert("epochTime: " + epochTime);
|
|
||||||
|
|
||||||
if (hours.length == 1)
|
if (hours.length == 1)
|
||||||
hours = "0" + hours;
|
hours = "0" + hours;
|
||||||
|
|
|
@ -43,8 +43,6 @@ function getTrackInfo(song){
|
||||||
str += song.track_title;
|
str += song.track_title;
|
||||||
if (song.artist_name != null)
|
if (song.artist_name != null)
|
||||||
str += " - " + song.artist_name;
|
str += " - " + song.artist_name;
|
||||||
//if (song.album_title != null)
|
|
||||||
//str += " - " + song.album_title;
|
|
||||||
|
|
||||||
str += ","
|
str += ","
|
||||||
|
|
||||||
|
@ -188,6 +186,7 @@ function calcAdditionalData(currentItem, bUpdateGlobalValues){
|
||||||
|
|
||||||
function parseItems(obj){
|
function parseItems(obj){
|
||||||
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime);
|
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime);
|
||||||
|
schedulePosixTime += parseInt(obj.timezoneOffset)*1000;
|
||||||
|
|
||||||
$('#time-zone').text(obj.timezone);
|
$('#time-zone').text(obj.timezone);
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,6 @@ def create_user(username):
|
||||||
print "Creating user "+username
|
print "Creating user "+username
|
||||||
os.system("adduser --system --quiet --group --shell /bin/bash "+username)
|
os.system("adduser --system --quiet --group --shell /bin/bash "+username)
|
||||||
|
|
||||||
#add pypo to audio group
|
|
||||||
os.system("adduser " + username + " audio")
|
|
||||||
|
|
||||||
#set pypo password
|
#set pypo password
|
||||||
p = os.popen('/usr/bin/passwd pypo', 'w')
|
p = os.popen('/usr/bin/passwd pypo', 'w')
|
||||||
p.write('pypo\n')
|
p.write('pypo\n')
|
||||||
|
@ -45,6 +42,8 @@ def create_user(username):
|
||||||
p.close()
|
p.close()
|
||||||
else:
|
else:
|
||||||
print "User already exists."
|
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):
|
def copy_dir(src_dir, dest_dir):
|
||||||
if (os.path.exists(dest_dir)) and (dest_dir != "/"):
|
if (os.path.exists(dest_dir)) and (dest_dir != "/"):
|
||||||
|
|
Loading…
Reference in New Issue