summaryrefslogtreecommitdiffstats
path: root/lib/class/artist.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-04 02:45:03 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-04 02:45:03 +0000
commit19276f57a9eeacae7829629baa35fcb28d77419f (patch)
tree35c2d658e6cb4e3b9e1a1706e0e3d3ab8af88f0d /lib/class/artist.class.php
parent848a1bc5388301e128cb5c2c4d8dcb5d06721bb4 (diff)
downloadampache-19276f57a9eeacae7829629baa35fcb28d77419f.tar.gz
ampache-19276f57a9eeacae7829629baa35fcb28d77419f.tar.bz2
ampache-19276f57a9eeacae7829629baa35fcb28d77419f.zip
fixed genre and artist view... mostly also fixed batch downloads
Diffstat (limited to 'lib/class/artist.class.php')
-rw-r--r--lib/class/artist.class.php22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index ee2aad62..7a07785d 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -95,7 +95,7 @@ class Artist {
* get_songs
* gets the songs for this artist
*/
- function get_songs() {
+ public function get_songs() {
$sql = "SELECT `song`.`id` FROM `song` WHERE `song`.`artist`='" . Dba::escape($this->id) . "'";
$db_results = Dba::query($sql);
@@ -126,21 +126,19 @@ class Artist {
} // get_song_ids
- /*!
- @function get_random_songs
- @discussion gets a random number, and
- a random assortment of songs from this
- album
- */
- function get_random_songs() {
+ /**
+ * get_random_songs
+ * Gets the songs from this artist in a random order
+ */
+ public function get_random_songs() {
$results = array();
- $sql = "SELECT id FROM song WHERE artist='$this->id' ORDER BY RAND() LIMIT " . rand(1,$this->songs);
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT `id` FROM `song` WHERE `artist`='$this->id' ORDER BY RAND()";
+ $db_results = Dba::query($sql);
- while ($r = mysql_fetch_array($db_results)) {
- $results[] = $r[0];
+ while ($r = Dba::fetch_assoc($db_results)) {
+ $results[] = $r['id'];
}
return $results;