summaryrefslogtreecommitdiffstats
path: root/lib/class/genre.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-11 05:16:20 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-11 05:16:20 +0000
commit689517e332c874ac09bb41398602622a1fc36af8 (patch)
treec97a077bd164e594211ed213405eb0cfbbf77b1c /lib/class/genre.class.php
parent7327a025db941554501bbbe79c057fa308fb205c (diff)
downloadampache-689517e332c874ac09bb41398602622a1fc36af8.tar.gz
ampache-689517e332c874ac09bb41398602622a1fc36af8.tar.bz2
ampache-689517e332c874ac09bb41398602622a1fc36af8.zip
fixed preferences mostly, also fixed some genre issues and other stuff I am forgetting now
Diffstat (limited to 'lib/class/genre.class.php')
-rw-r--r--lib/class/genre.class.php34
1 files changed, 14 insertions, 20 deletions
diff --git a/lib/class/genre.class.php b/lib/class/genre.class.php
index 7e311fda..90db7d53 100644
--- a/lib/class/genre.class.php
+++ b/lib/class/genre.class.php
@@ -91,34 +91,30 @@ class Genre {
/**
* get_album_count
* Returns the number of albums that contain a song of this genre
- * @package Genre
- * @catagory Class
*/
- function get_album_count() {
+ public function get_album_count() {
- $sql = "SELECT COUNT(DISTINCT(song.album)) FROM song WHERE genre='" . $this->id . "'";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT COUNT(DISTINCT(song.album)) FROM `song` WHERE `genre`='" . $this->id . "'";
+ $db_results = Dba::query($sql);
- $total_items = mysql_fetch_array($db_results);
+ $total_items = Dba::fetch_row($db_results);
- return $total_items[0];
+ return $total_items['0'];
} // get_album_count
/**
* get_artist_count
* Returns the number of artists who have at least one song in this genre
- * @package Genre
- * @catagory Class
*/
- function get_artist_count() {
+ public function get_artist_count() {
- $sql = "SELECT COUNT(DISTINCT(song.artist)) FROM song WHERE genre='" . $this->id . "'";
- $db_results = mysql_query($sql, dbh());
+ $sql = "SELECT COUNT(DISTINCT(`song`.`artist`)) FROM `song` WHERE `genre`='" . $this->id . "'";
+ $db_results = Dba::query($sql);
- $total_items = mysql_fetch_array($db_results);
+ $total_items = Dba::fetch_row($db_results);
- return $total_items[0];
+ return $total_items['0'];
} // get_artist_count
@@ -169,15 +165,13 @@ class Genre {
*/
function get_albums() {
- $sql = "SELECT DISTINCT(song.album) FROM song WHERE genre='" . $this->id . "'";
- $db_results = mysql_query($sql,dbh());
+ $sql = "SELECT DISTINCT(`song`.`album`) FROM `song` WHERE `genre`='" . $this->id . "'";
+ $db_results = Dba::query($sql);
$results = array();
- while ($r = mysql_fetch_assoc($db_results)) {
- $album = new Album($r['album']);
- $album->format_album();
- $results[] = $album;
+ while ($r = Dba::fetch_row($db_results)) {
+ $results[] = $r['0'];
}
return $results;