librefm-commits
[Top][All Lists]
Advanced

[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: Wed, 03 Jun 2009 14:50:03 +0000

Revision: 1895
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1895
Author:   clint
Date:     2009-06-03 14:50:02 +0000 (Wed, 03 Jun 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-06-03 14:49:59 UTC (rev 1894)
+++ trunk/nixtape/api/UserXML.php       2009-06-03 14:50:02 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-06-03 14:49:59 UTC (rev 1894)
+++ trunk/nixtape/data/Server.php       2009-06-03 14:50:02 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-06-03 14:49:59 UTC (rev 1894)
+++ trunk/nixtape/data/User.php 2009-06-03 14:50:02 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;
        }





reply via email to

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