From ffac7359918b54193dab135d2ab7310271f5902b Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Wed, 4 Jan 2006 09:01:36 +0000 Subject: fixed a few more playlist functions... cleaned up some code... --- lib/class/catalog.class.php | 4 ++-- lib/class/playlist.class.php | 4 ++-- lib/class/song.class.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') 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); -- cgit