Skip to content

Commit

Permalink
Added debug mode for sab downloads and tv today
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaines committed May 7, 2012
1 parent c1de142 commit a8096f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 13 additions & 3 deletions index.php
Expand Up @@ -25,7 +25,12 @@
<div class="sickbeardShows">
<h3>TV Today</h3>
<?php
$sbJSON = file_get_contents($sickbeardURL."/api/".$config['sickbeardAPI']."/?cmd=future&sort=date&type=".$sbType);

$sbJSONURL = $sickbeardURL."/api/".$config['sickbeardAPI']."/?cmd=future&sort=date&type=".$sbType;

if($config['debug']) {echo "TV Today URL: ".$sbJSONURL;}

$sbJSON = file_get_contents($sbJSONURL);
$sbShows = json_decode($sbJSON);

echo "<ul class='comingShows'>";
Expand Down Expand Up @@ -54,10 +59,13 @@
}
echo "</ul>";

$sbJSONdone = file_get_contents($sickbeardURL."/api/".$config['sickbeardAPI']."/?cmd=history&limit=50");
$sbJSONdoneURL = $sickbeardURL."/api/".$config['sickbeardAPI']."/?cmd=history&limit=50";
$sbJSONdone = file_get_contents($sbJSONdoneURL);
$sbShowsdone = json_decode($sbJSONdone);
$todaysDate = date('Y-m-d');

if($config['debug']){echo "TV Complete Today URL: ".$sbJSONdoneURL;}

echo "<ul class='snatchedShows'>";

# List shows
Expand Down Expand Up @@ -116,7 +124,9 @@
<a href="#" class="go actionButton small">&gt;</a>
<?php

$data = simplexml_load_file($sabURL."/sabnzbd/api?mode=qstatus&output=xml&apikey=".$config['sabnzbdAPI']);
$sabStatusXML = $sabURL."/sabnzbd/api?mode=qstatus&output=xml&apikey=".$config['sabnzbdAPI'];
if($config['debug']){echo "SABnzbd Status URL: ".$sabStatusXML;}
$data = simplexml_load_file($sabStatusXML);
$filename = $data->jobs[0]->job->filename;
$mbFull = $data->jobs[0]->job->mb;
$mbLeft = $data->jobs[0]->job->mbleft;
Expand Down
3 changes: 3 additions & 0 deletions intranet/serverconfig-example.php
Expand Up @@ -52,6 +52,9 @@
# Show popups when hovering over coming shows?
"sickPopups" => true,

# Debug
"debug" => false,

# Show trailers button
"showTrailers" => true,

Expand Down

0 comments on commit a8096f2

Please sign in to comment.