librefm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Librefm-commits] [1892] use userid instead of username


From: Clint Adams
Subject: [Librefm-commits] [1892] use userid instead of username
Date: Wed, 03 Jun 2009 14:49:53 +0000

Revision: 1892
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1892
Author:   clint
Date:     2009-06-03 14:49:53 +0000 (Wed, 03 Jun 2009)
Log Message:
-----------
use userid instead of username

Modified Paths:
--------------
    trunk/nixtape/api/UserXML.php

Modified: trunk/nixtape/api/UserXML.php
===================================================================
--- trunk/nixtape/api/UserXML.php       2009-06-03 14:49:50 UTC (rev 1891)
+++ trunk/nixtape/api/UserXML.php       2009-06-03 14:49:53 UTC (rev 1892)
@@ -21,6 +21,7 @@
 require_once($install_path . '/database.php');
 require_once($install_path . '/data/User.php');
 require_once('xml.php');
+require_once($install_path . '/../turtle/temp-utils.php'); // this is 
extremely dodgy and shameful
 
 class UserXML {
 
@@ -71,7 +72,7 @@
                try {
                        $res = $adodb->CacheGetAll(600, 'SELECT Track.*, 
Artist.mbid AS artmbid, COUNT(*) AS freq
                                        FROM Track, Scrobbles,Artist
-                                       WHERE Scrobbles.username = ' . 
$adodb->qstr($username, 'text') . '
+                                       WHERE Scrobbles.userid = ' . 
username_to_uniqueid($username) . '
                                        AND Scrobbles.track = Track.name AND 
Scrobbles.time > ' . $timestamp . ' AND Track.artist = Artist.name
                                        GROUP BY Track.name ORDER BY freq DESC 
LIMIT 20');
                }
@@ -115,7 +116,7 @@
                try {
                        $res = $adodb->GetAll('SELECT Track . * , COUNT( * ) AS 
freq
                                        FROM Track, Scrobbles
-                                       WHERE Scrobbles.username = ' . 
$adodb->qstr($user) . '
+                                       WHERE Scrobbles.userid = ' . 
username_to_uniqueid($user) . '
                                        AND Scrobbles.track = Track.name
                                        GROUP BY Track.name
                                        LIMIT 10');





reply via email to

[Prev in Thread] Current Thread [Next in Thread]