Skip to content

Commit

Permalink
Add Album selector to controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello authored Feb 1, 2017
1 parent b85d0ae commit a0759d7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controller/categorycontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ private function getCategoryforUser($category){
WHERE AT.`user_id` = ?
ORDER BY LOWER(FC.`name`) ASC
";
} elseif ($category === 'Album') {
$SQL="SELECT `id`,`name`, LOWER(`name`) AS `lower`
FROM `*PREFIX*audioplayer_albums`
WHERE `user_id` = ?
ORDER BY LOWER(`name`) ASC
";
}

$stmt =$this->db->prepareQuery($SQL);
Expand Down Expand Up @@ -180,6 +186,14 @@ private function getSongIdsForCategory($category,$categoryId){
WHERE `AT`.`folder_id` = ?
AND `AT`.`user_id` = ?
ORDER BY LOWER(`AT`.`title`) ASC";
} elseif ($category === 'Album') {
$SQL="SELECT `AT`.`id` , `AT`.`title` ,`AT`.`number` ,`AT`.`length` ,`AA`.`name` AS `artist`, `AB`.`name` AS `album`,`AT`.`file_id`,LOWER(`AT`.`title`) AS `lower`
FROM `*PREFIX*audioplayer_tracks` `AT`
LEFT JOIN `*PREFIX*audioplayer_artists` `AA` ON `AT`.`artist_id` = `AA`.`id`
LEFT JOIN `*PREFIX*audioplayer_albums` `AB` ON `AT`.`album_id` = `AB`.`id`
WHERE `AB`.`id` = ?
AND `AB`.`user_id` = ?
ORDER BY LOWER(`AT`.`title`) ASC";
}

$stmt = $this->db->prepareQuery($SQL);
Expand Down

0 comments on commit a0759d7

Please sign in to comment.