librefm-commits
[Top][All Lists]
Advanced

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

[Librefm-commits] [1282] Fix for bug 26489, show correct number of plays


From: Jørgen Bøhnsdalen
Subject: [Librefm-commits] [1282] Fix for bug 26489, show correct number of plays for track with no plays.
Date: Thu, 07 May 2009 19:21:43 +0000

Revision: 1282
          http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1282
Author:   jurgbohn
Date:     2009-05-07 19:21:42 +0000 (Thu, 07 May 2009)
Log Message:
-----------
Fix for bug 26489, show correct number of plays for track with no plays.

Modified Paths:
--------------
    trunk/nixtape/api/ArtistXML.php
    trunk/nixtape/data/Track.php

Modified: trunk/nixtape/api/ArtistXML.php
===================================================================
--- trunk/nixtape/api/ArtistXML.php     2009-05-07 17:08:53 UTC (rev 1281)
+++ trunk/nixtape/api/ArtistXML.php     2009-05-07 19:21:42 UTC (rev 1282)
@@ -51,6 +51,7 @@
                $artistXml = $xml->addChild("artist", null);
                $artistXml->addChild("name", $artist->name);
                $artistXml->addChild("mbid", $artist->mbid);
+               $artistXml->addChild("url", $artist->getURL());
                $artistXml->addChild("streamable", $artist->streamable);
 
                $bio = $artistXml->addChild("bio", null);

Modified: trunk/nixtape/data/Track.php
===================================================================
--- trunk/nixtape/data/Track.php        2009-05-07 17:08:53 UTC (rev 1281)
+++ trunk/nixtape/data/Track.php        2009-05-07 19:21:42 UTC (rev 1282)
@@ -126,8 +126,13 @@
                        . " GROUP BY track ORDER BY freq DESC");
 
                $row = $res->fetchRow(MDB2_FETCHMODE_ASSOC);
-               $this->_playcount = $row['freq'];
-               $this->_listenercount = $row['listeners'];
+               if (!isset($row)) {
+                       $this->setPlaycount(0);
+                       $this->setListenerCount(0);
+               } else {
+                       $this->setPlaycount($row['freq']);
+                       $this->setListenerCount($row['listeners']);
+               }
        }
 
        /**





reply via email to

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