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

Commit 522518a8 authored by Mike Sheldon's avatar Mike Sheldon

Reduce number of queries needed for playlist generation

parent 18c120cd
......@@ -33,18 +33,15 @@ if(!isset($_GET['sk']) || !isset($_GET['desktop'])) {
$session = $_GET['sk'];
$res = $adodb->GetOne('SELECT url FROM Radio_Sessions WHERE session = ' . $adodb->qstr($session));
$res = $adodb->GetRow('SELECT username, url FROM Radio_Sessions WHERE session = ' . $adodb->qstr($session));
if(!$res) {
die("BADSESSION\n"); // this should return a blank dummy playlist instead
}
$username = $adodb->GetOne('SELECT username FROM Radio_Sessions WHERE '
. 'sk = ' . $adodb->qstr($_REQUEST['sk']) . ' AND '
. 'username IS NOT NULL');
$user = new User($username);
$user = new User($row['username']);
$url = $res;
$url = $row['url'];
$title = radio_title_from_url($url);
$smarty->assign('title', $title);
......
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