summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-04 09:01:36 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-04 09:01:36 +0000
commitffac7359918b54193dab135d2ab7310271f5902b (patch)
tree5c8343c419b90ca2c06c2773691ecc8863f9983a /lib
parent4e9823cd1064cc876b449752b933c89c367d84c6 (diff)
downloadampache-ffac7359918b54193dab135d2ab7310271f5902b.tar.gz
ampache-ffac7359918b54193dab135d2ab7310271f5902b.tar.bz2
ampache-ffac7359918b54193dab135d2ab7310271f5902b.zip
fixed a few more playlist functions... cleaned up some code...
Diffstat (limited to 'lib')
-rw-r--r--lib/class/catalog.class.php4
-rw-r--r--lib/class/playlist.class.php4
-rw-r--r--lib/class/song.class.php2
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 19cfd0ba..e7b6357b 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -856,7 +856,7 @@ class Catalog {
$new_song->artist = $this->check_artist($artist);
$new_song->f_artist = $artist;
$new_song->genre = $this->check_genre($genre);
- $new_song->f_genre = $genre;
+ $new_song->f_genre = $new_song->get_genre_name();
$new_song->album = $this->check_album($album,$new_song->year);
$new_song->f_album = $album . " - " . $new_song->year;
$new_song->title = $this->check_title($new_song->title,$new_song->file);
@@ -1793,7 +1793,7 @@ class Catalog {
function check_genre($genre) {
/* If a genre isn't specified force one */
- if (strlen($genre) < 1) {
+ if (strlen(trim($genre)) < 1) {
$genre = "Unknown (Orphaned)";
}
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 0ab165cd..23b1f5f2 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -224,10 +224,10 @@ class Playlist {
} // update_name
/**
- * update_item
+ * _update_item
* This is the generic update function, it does the escaping and error checking
*/
- function update_item($field,$value,$level) {
+ function _update_item($field,$value,$level) {
if ($GLOBALS['user']->username != $this->user AND !$GLOBALS['user']->has_access($level)) {
return false;
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index e0f7dd36..35fca013 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -109,7 +109,7 @@ class Song {
"title,bitrate,rate,mode,size,time,track,genre,played,song.enabled,update_time,".
"addition_time,flagged.id as flagid,flagged.user as flaguser,flagged.type ".
"as flagtype,flagged.date as flagdate,flagged.comment as flagcomment FROM ".
- "song LEFT JOIN flagged ON song.id = flagged.song WHERE song.id = '$this->id'";
+ "song LEFT JOIN flagged ON song.id = flagged.song WHERE song.id = '" . sql_escape($this->id) . "'";
$db_results = mysql_query($sql, dbh());
$results = mysql_fetch_object($db_results);