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

Commit d941864b authored by clint's avatar clint

break Now_Playing halfway.

parent cea6fec0
......@@ -114,7 +114,7 @@ if (isset($_POST['install'])) {
PRIMARY KEY(username, sessionid))");
$res = $mdb2->query("CREATE TABLE Now_Playing(
username VARCHAR(64) PRIMARY KEY REFERENCES Users(username),
sessionid VARCHAR(32) PRIMARY KEY REFERENCES Scrobble_Sessions(sessionid),
track VARCHAR(255) REFERENCES Track(name),
artist VARCHAR(255) REFERENCES Artist(name),
mbid VARCHAR(36),
......
......@@ -61,10 +61,10 @@ createTrackIfNew($artist, $album, $track, $mbid);
$mdb2->query("DELETE FROM Now_Playing WHERE expires < " . time());
//Delete this user's last playing song (if any)
$mdb2->query("DELETE FROM Now_Playing WHERE username = " . $username);
$mdb2->query("DELETE FROM Now_Playing WHERE sessionid = " . $session_id);
$mdb2->query("INSERT INTO Now_Playing (username, artist, track, expires, mbid) VALUES ("
. $username . ", "
$mdb2->query("INSERT INTO Now_Playing (sessionid, artist, track, expires, mbid) VALUES ("
. $session_id . ", "
. $artist . ", "
. $track . ", "
. $expires . ", "
......
......@@ -72,7 +72,7 @@ for($i = 0; $i < count($_POST['a']); $i++) {
. $mbid . ")");
// Destroy now_playing since it is almost certainly obsolescent
$mdb2->query("DELETE FROM Now_Playing WHERE username = " . $username);
$mdb2->query("DELETE FROM Now_Playing WHERE sessionid = " . $session_id);
}
die("OK\n");
......
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