From 7aef077622b2f041a1aac89205311c8c22db1d7a Mon Sep 17 00:00:00 2001 From: Git Date: Sat, 2 Feb 2013 08:00:44 +0000 Subject: [PATCH] Empty commit --- sections/schedule/index.php | 7 ++++--- static/functions/lastfm.js | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sections/schedule/index.php b/sections/schedule/index.php index ddf83b9b..e8d5ec2c 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -3,9 +3,10 @@ ob_end_flush(); gc_enable(); -$PCount = shell_exec("/usr/bin/pgrep -cf schedule.php"); -if ($PCount >= 0) { - die(); +$PCount = chop(shell_exec("/usr/bin/pgrep -cf schedule.php")); +if ($PCount > 3) { + // 3 because the cron job starts two processes and pgrep finds itself + die("schedule.php is already running. Exiting ($PCount)\n"); } //TODO: make it awesome, make it flexible! diff --git a/static/functions/lastfm.js b/static/functions/lastfm.js index 76ed4f5e..b188be4a 100644 --- a/static/functions/lastfm.js +++ b/static/functions/lastfm.js @@ -215,7 +215,7 @@ // Fix Last.fm API returning more than one entry despite limit on certain conditions. if ( typeof(json[0]) === "object" ) json = json[0]; html += '
  • Last played: '; - html += '' + escapeHtml(json['artist']['#text']) + ' - ' + escapeHtml(json['name']) + ''; + html += '' + escapeHtml(json['artist']['#text']) + ' - ' + escapeHtml(json['name']) + ''; html += "
  • "; lastPlayedTrack = html; } @@ -336,11 +336,11 @@ var k = initialCount; if (j.length < 3) k = j.length; for (var i = 0; i < k; i++) { - html += '
  • ' + escapeHtml(j[i]['artist']['name']) + ' - ' + escapeHtml(j[i]['name']) + '
  • ' + html += '
  • ' + escapeHtml(j[i]['artist']['name']) + ' - ' + escapeHtml(j[i]['name']) + '
  • ' } if ( j.length>3 ){ for (i = 3; i < j.length; i++) { - html += '' + html += '' } html+= '
  • [Expand]
  • ' }