Commit b5bee866 authored by P. J. McDermott's avatar P. J. McDermott

Finish code cleanup under nixtape/data/.

parent 6f19e0df
......@@ -227,13 +227,13 @@ class Album {
foreach ($search_results['query']['search'] as $id => $page) {
switch ($page['title']) {
case ($album_name):
case $album_name:
$weight = 0.5;
break;
case ("$album_name (album)"):
case "$album_name (album)":
$weight = 0.75;
break;
case ("$album_name ($artist_name album)"):
case "$album_name ($artist_name album)":
$weight = 1;
break;
default:
......
......@@ -53,8 +53,7 @@ class Group {
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
try {
$res = $adodb->GetRow('SELECT * FROM Groups WHERE lower(groupname) = lower(' . $adodb->qstr($name) . ')');
}
catch (Exception $e) {
} catch (Exception $e) {
header('Content-Type: text/plain');
exit;
}
......
......@@ -507,13 +507,13 @@ class User {
*/
function getNeighbours($limit=10) {
global $adodb;
if(!$this->hasLoved()) {
if (!$this->hasLoved()) {
return array();
}
$res = $adodb->CacheGetAll(7200, 'SELECT Loved_Tracks.userid AS userid, count(Loved_Tracks.userid) AS shared_artists FROM Loved_Tracks INNER JOIN (SELECT DISTINCT(artist) AS artist FROM Loved_Tracks WHERE userid=' . $this->uniqueid . ') AS Loved_Artists ON Loved_Tracks.artist = Loved_Artists.artist WHERE userid != ' . $this->uniqueid . ' GROUP BY Loved_Tracks.userid ORDER BY shared_artists DESC LIMIT ' . $limit);
foreach($res as &$neighbour) {
foreach ($res as &$neighbour) {
$neighbour['user'] = User::new_from_uniqueid_number($neighbour['userid']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment