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

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