Skip to content

Commit

Permalink
fix for crossroads, empty genre chart
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Apr 29, 2019
1 parent a6bda6a commit 5aac615
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion controllers/RunDaily.php
Expand Up @@ -159,6 +159,7 @@ private function getAddresses() {

private function buildChart($start, $end, $limit="", $category="", $cmj=0, $crd=0) {
$result = "";
$chart = [];
$chartApi = Engine::api(IChart::class);
$chartApi->getChart($chart, $start, $end, $limit, $category);
if(sizeof($chart)) {
Expand All @@ -179,7 +180,12 @@ private function buildChart($start, $end, $limit="", $category="", $cmj=0, $crd=
else if(!$crd)
$line = sprintf("%4s %-23s %-26s %23s\n",
"Rank", "Artist", "Album", "Label");
$result .= $line;
else
$line = "";

if($line)
$result .= $line;

for($i=0; $i < sizeof($chart); $i++) {
// Fixup the artist, album, and label names
$artist = $chart[$i]["artist"];
Expand Down

0 comments on commit 5aac615

Please sign in to comment.