[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1895] reduce number of conversions for getRecentScrob
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1895] reduce number of conversions for getRecentScrobbles |
Date: |
Sat, 30 May 2009 00:24:29 +0000 |
Revision: 1895
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1895
Author: clint
Date: 2009-05-30 00:24:29 +0000 (Sat, 30 May 2009)
Log Message:
-----------
reduce number of conversions for getRecentScrobbles
Modified Paths:
--------------
trunk/nixtape/api/UserXML.php
trunk/nixtape/data/Server.php
trunk/nixtape/data/User.php
Modified: trunk/nixtape/api/UserXML.php
===================================================================
--- trunk/nixtape/api/UserXML.php 2009-05-30 00:17:26 UTC (rev 1894)
+++ trunk/nixtape/api/UserXML.php 2009-05-30 00:24:29 UTC (rev 1895)
@@ -111,7 +111,6 @@
$user = new User($user);
$res = $user->getScrobbles($limit);
} catch (exception $e) {
-die($e);
$err = 1;
}
Modified: trunk/nixtape/data/Server.php
===================================================================
--- trunk/nixtape/data/Server.php 2009-05-30 00:17:26 UTC (rev 1894)
+++ trunk/nixtape/data/Server.php 2009-05-30 00:24:29 UTC (rev 1895)
@@ -44,7 +44,7 @@
* @param int $number The number of scrobbles to return
* @return An array of scrobbles or null in case of failure
*/
- static function getRecentScrobbles($number=10, $username=false) {
+ static function getRecentScrobbles($number=10, $userid=false) {
global $adodb;
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
@@ -73,7 +73,7 @@
ON s.stid = st.id
LEFT JOIN Track t
ON st.track = t.id
- WHERE s.userid = ' .
username_to_uniqueid($username) . '
+ WHERE s.userid = ' . ($userid) . '
ORDER BY
s.time DESC
LIMIT ' . (int)($number));
Modified: trunk/nixtape/data/User.php
===================================================================
--- trunk/nixtape/data/User.php 2009-05-30 00:17:26 UTC (rev 1894)
+++ trunk/nixtape/data/User.php 2009-05-30 00:24:29 UTC (rev 1895)
@@ -164,7 +164,7 @@
* @return An array of scrobbles with human time
*/
function getScrobbles($number) {
- $data = Server::getRecentScrobbles($number, $this->name);
+ $data = Server::getRecentScrobbles($number, $this->uniqueid);
if(!isset($data)) { return array(); }
return $data;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1895] reduce number of conversions for getRecentScrobbles,
Clint Adams <=