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

Commit c788bc7b authored by clint's avatar clint

give free tracks precedence in Now_Playing list

parent 44cc1851
......@@ -137,7 +137,7 @@ if (isset($_POST['install'])) {
album VARCHAR(255),
mbid VARCHAR(36),
duration INTEGER,
streamable INTEGER,
streamable INTEGER DEFAULT 0,
license VARCHAR(255),
downloadurl VARCHAR(255),
streamurl VARCHAR(255),
......@@ -151,7 +151,7 @@ if (isset($_POST['install'])) {
album VARCHAR(255),
mbid VARCHAR(36),
duration INTEGER,
streamable INTEGER,
streamable INTEGER DEFAULT 0,
license VARCHAR(255),
downloadurl VARCHAR(255),
streamurl VARCHAR(255),
......
......@@ -202,7 +202,7 @@ class Server {
AND lower(n.album) = lower(t.album)
AND lower(n.track) = lower(t.name)
WHERE lower(username) = " . $mdb2->quote(strtolower($username), "text") . "
ORDER BY n.expires DESC LIMIT " . $mdb2->quote($number, "integer"));
ORDER BY t.streamable DESC, n.expires DESC LIMIT " . $mdb2->quote($number, "integer"));
} else {
$res = $mdb2->query("SELECT
username,
......@@ -224,7 +224,7 @@ class Server {
ON lower(n.artist) = lower(t.artist)
AND lower(n.album) = lower(t.album)
AND lower(n.track) = lower(t.name)
ORDER BY n.expires DESC LIMIT " . $mdb2->quote($number, "integer"));
ORDER BY t.streamable DESC, n.expires DESC LIMIT " . $mdb2->quote($number, "integer"));
}
if(PEAR::isError($res)) {
......
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