We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 67e8b29f authored by Mike Sheldon's avatar Mike Sheldon

Make a user's loved tracks playable from their profile page

parent 05b82c90
......@@ -196,6 +196,11 @@ public class LibreDroid extends ListActivity {
super.onDestroy();
}
@Override
public void onListItemClick(ListView l, View v, int pos, long id) {
super.onListItemClick(l, v, pos, id);
}
public void updateSong() {
Song song = libreServiceConn.service.getSong();
final TextView titleText = (TextView) findViewById(R.id.titleText);
......
......@@ -350,4 +350,19 @@ class User {
return $res != 0;
}
/**
* Checks whether this user has any loved tracks
*
* @return Boolean indicating whether this user has marked any tracks as being loved in the past.
*/
function hasLoved() {
global $adodb;
$res = $adodb->GetOne('SELECT COUNT(*) FROM Loved_Tracks WHERE '
. ' userid = ' . $this->uniqueid);
return $res != 0;
}
}
......@@ -52,6 +52,14 @@ if(isset($user->name)) {
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$station = 'librefm://user/' . $user->name . '/loved';
if(isset($this_user)) {
$radio_session = $this_user->getRadioSession($station);
} else {
$radio_session = Server::getRadioSession($station);
}
$smarty->assign('radio_session', $radio_session);
$smarty->assign('extra_head_links', array(
array(
'rel'=>'alternate',
......
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