Commit a096b46e authored by Jonas Haraldsson's avatar Jonas Haraldsson

set station for logged in users

parent 8e558595
......@@ -28,11 +28,11 @@ require_once('artist-menu.php');
$station = 'librefm://artist/' . $artist->name;
if (isset($this_user)) {
$radio_session = $this_user->getRadioSession($station);
$smarty->assign('station', $station);
} else {
$radio_session = Server::getRadioSession($station);
$smarty->assign('radio_session', $radio_session);
}
$smarty->assign('radio_session', $radio_session);
$smarty->assign('name', $artist->name);
$smarty->assign('id', $artist->id);
......
......@@ -34,11 +34,11 @@ if (isset($_GET['only_loved']) && $_GET['only_loved']) {
if (isset($station)) {
if (isset($this_user)) {
$radio_session = $this_user->getRadioSession($station);
$smarty->assign('station', $station);
} else {
$radio_session = Server::getRadioSession($station);
$smarty->assign('radio_session', $radio_session);
}
$smarty->assign('radio_session', $radio_session);
}
$smarty->assign('pageheading', _('Go ahead, listen all you want'));
$smarty->display('listen.tpl');
......@@ -80,14 +80,16 @@
{if $playlist == 'track'}
var playlist = [{ldelim}"artist" : "{$track->artist_name|escape:'javascript'}", "album" : "{$track->album_name|escape:'javascript'}", "track" : "{$track->name|escape:'javascript'}", "url" : "{$track->streamurl}"{rdelim}];
var radio_session = false;
var station = false;
{else}
var playlist = false;
var radio_session = "{$radio_session}";
var station = "{$station}";
{/if}
{if isset($this_user)}
playerInit(playlist, "{$this_user->getScrobbleSession()}", "{$this_user->getWebServiceSession()}", radio_session);
playerInit(playlist, "{$this_user->getScrobbleSession()}", "{$this_user->getWebServiceSession()}", false, station);
{else}
playerInit(playlist, false, false, radio_session);
playerInit(playlist, false, false, radio_session, false);
{/if}
{rdelim});
</script>
......@@ -50,11 +50,11 @@ if (isset($user->name)) {
$station = 'librefm://user/' . $user->name . '/' . $type;
if (isset($this_user)) {
$radio_session = $this_user->getRadioSession($station);
$smarty->assign('station', $station);
} else {
$radio_session = Server::getRadioSession($station);
$smarty->assign('radio_session', $radio_session);
}
$smarty->assign('radio_session', $radio_session);
$submenu = user_menu($user, 'Radio Stations');
$smarty->assign('submenu', $submenu);
......
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