Skip to content
Permalink
Browse files

Dead code removal and clean-up (#74)

* removed dead code and unreferenced variables
* renamed getX2 methods to getX
* deprecated LABEL, LABELNAME
* updated DJ Zone! for multibyte
* made \DateTime references explicit and fixed failure check
  • Loading branch information...
RocketMan committed Oct 8, 2019
1 parent ed459fb commit 78d8640a6039d1bd84e5747e28df349aa1562391
@@ -188,18 +188,18 @@ public function getCharts() {
$chartfields = API::ALBUM_FIELDS;
array_push($chartfields, "label", "rank");
self::array_remove($chartfields, "name", "address", "city", "state", "zip", "location", "bin");
self::array_remove($chartfields, "name", "address", "city", "state", "zip", "location", "bin", "created", "updated");
if(!$date) {
$weeks = Engine::api(IChart::class)->getChartDates(1);
$week = $weeks->fetch();
$date = $week["week"];
}
$this->startResponse("getChartRs");
$this->startResponse("getChartsRs");
// main chart
Engine::api(IChart::class)->getChart2($records, 0, $date, 30);
Engine::api(IChart::class)->getChart($records, 0, $date, 30);
$attrs = [];
$attrs["chart"] = "General";
@@ -212,7 +212,7 @@ public function getCharts() {
$genres = [5, 7, 6, 1, 2, 4, 3, 8];
for($i=0; $i<sizeof($genres); $i++) {
unset($records);
Engine::api(IChart::class)->getChart2($records, 0, $date, 10, $genres[$i]);
Engine::api(IChart::class)->getChart($records, 0, $date, 10, $genres[$i]);
$attrs = [];
$attrs["chart"] = $this->catCodes[$genres[$i]-1]["name"];
$attrs["week-ending"] = $date;
@@ -221,7 +221,7 @@ public function getCharts() {
$this->endResponse("chart");
}
$this->endResponse("getChartRs");
$this->endResponse("getChartsRs");
}
public function getPlaylists() {
@@ -354,7 +354,7 @@ public function getCurrents() {
self::array_remove($currentfields, "name", "address",
"city", "state", "zip");
$records = Engine::api(IChart::class)->getCurrentsWithPlays2();
$records = Engine::api(IChart::class)->getCurrentsWithPlays();
$this->startResponse("getCurrentsRs");
$this->emitDataSet("albumrec", $currentfields, $records);
$this->endResponse("getCurrentsRs");
@@ -57,10 +57,10 @@ public function processRequest($dispatcher) {
$cats = Engine::api(IChart::class)->getCategories();
// Get the add records
$records = Engine::api(IChart::class)->getAdd2($date);
$records = Engine::api(IChart::class)->getAdd($date);
// Retrieve the albums into an array
(new AddManager())->addManagerGetAlbums2($records, $albums);
(new AddManager())->addManagerGetAlbums($records, $albums);
// Emit the albums
foreach($albums as $index => $row) {
@@ -55,7 +55,7 @@ public function processRequest($dispatcher) {
$displayDate = date("l, j F Y");
$station = Engine::param("station");
echo " <H2 CLASS=\"header\">$station A-FILE AS OF " . strtoupper($displayDate) . "</H2>\n";
$results = Engine::api(IChart::class)->getCurrents2(date("Y-m-d"));
$results = Engine::api(IChart::class)->getCurrents(date("Y-m-d"));
$addmgr = new AddManager();
$addmgr->session = Engine::session();
$addmgr->addManagerEmitAlbums($results, "", false, true, true, true);
@@ -93,7 +93,7 @@ public function emitChartRSS($endDate, &$title, $limit="", $category="") {
for($i=0; $i < sizeof($chart); $i++) {
// Fixup the artist, album, and label names
$artist = $chart[$i]["artist"];
$label = str_replace(" Records", "", $chart[$i]["LABEL"]);
$label = str_replace(" Records", "", $chart[$i]["label"]);
$label = str_replace(" Recordings", "", $label);
// Setup medium
@@ -232,7 +232,7 @@ public function recentReviews() {
public function emitAddRSS($addDate, &$title) {
$station = Engine::param('station');
$results = Engine::api(IChart::class)->getAdd2($addDate);
$results = Engine::api(IChart::class)->getAdd($addDate);
if($results) {
$title = "$station Adds ";
@@ -189,7 +189,7 @@ private function buildChart($start, $end, $limit="", $category="", $cmj=0, $crd=
for($i=0; $i < sizeof($chart); $i++) {
// Fixup the artist, album, and label names
$artist = $chart[$i]["artist"];
$label = str_replace(" Records", "", $chart[$i]["LABEL"]);
$label = str_replace(" Records", "", $chart[$i]["label"]);
$label = str_replace(" Recordings", "", $label);
// Setup medium
@@ -36,11 +36,8 @@ function updateCategory($i, $name, $code, $dir, $email);
function getNextAID();
function getAddDates($limit="");
function getAdd($date);
function getAdd2($date);
function getCurrents($date);
function getCurrents2($date, $sort=0);
function getCurrentsWithPlays($date);
function getCurrentsWithPlays2($date=0);
function getCurrents($date, $sort=0);
function getCurrentsWithPlays($date=0);
function addAlbum($aid, $tag, $adddate, $pulldate, $cats);
function updateAlbum($id, $aid, $tag, $adddate, $pulldate, $cats);
function deleteAlbum($id);
@@ -51,10 +48,7 @@ function getChartDates($limit=0);
function getChartDatesByYear($year, $limit=0);
function getChartYears($limit=0);
function getChartMonths($limit=0);
function getChartSortFn($a, $b);
function getChart(&$result, $startDate, $endDate, $limit="", $category="");
function getChart2(&$result, $startDate, $endDate, $limit="", $category="");
function getBottom(&$result, $startDate, $endDate, $limit="", $category="");
function getChartEMail();
function updateChartEMail($i, $address);
function getWeeklyActivity($date);

0 comments on commit 78d8640

Please sign in to comment.
You can’t perform that action at this time.