Skip to content

Commit

Permalink
revised top plays lookback horizon to 7 days
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed May 4, 2024
1 parent 6e5179e commit 17c80c4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ui/Playlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -1024,18 +1024,17 @@ public function emitViewDJ() {
}

public function emitTopPlays() {
$weeks = 6;
$days = 7;
$limit = 30;
$formatEndDate = date("l, j F Y");

$topPlays = Engine::api(IPlaylist::class)->getTopPlays(0, $weeks * 7, $limit);
$topPlays = Engine::api(IPlaylist::class)->getTopPlays(0, $days, $limit);

if(!sizeof($topPlays)) {
echo " <h2>No top airplay is available</h2>\n";
return;
}

echo " <h2>Top airplay for the $weeks week period ending $formatEndDate</h2>\n";
echo " <h2>Top airplay for the last $days days</h2>\n";
echo " <table class='playlistTable' cellpadding='1'>\n";
echo " <thead>\n";
echo " <tr class='playlistHdr' align=left><th></th><th>Artist</th><th></th><th>Album/Label</th></tr>";
Expand Down

0 comments on commit 17c80c4

Please sign in to comment.