summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/playlist.class.php2
-rw-r--r--lib/class/update.class.php18
-rw-r--r--song.php4
3 files changed, 22 insertions, 2 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 201b63e1..f0ef69ff 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -119,7 +119,6 @@ class Playlist {
$results = array();
while ($r = mysql_fetch_assoc($db_results)) {
-
if ($r['dyn_song']) {
$array = $this->get_dyn_songs($r['dyn_song']);
$results = array_merge($array,$results);
@@ -172,7 +171,6 @@ class Playlist {
* Query has to return id which must be a song.id
*/
$db_results = mysql_query($dyn_string, dbh());
-
$results = array();
while ($r = mysql_fetch_assoc($db_results)) {
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index e6dfbb84..597a37cf 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -259,6 +259,10 @@ class Update {
$version[] = array('version' => '332006','description' => $update_string);
+ $update_string = '- Alters the Dynamic Song field to be TEXT instead of Varchar (varchar was not long enough).';
+
+ $version[] = array('version' => '332007','description' => $update_string);
+
return $version;
} // populate_version
@@ -1386,5 +1390,19 @@ class Update {
} // update_332006
+ /**
+ * update_332007
+ * Arg... I'm tried of writting these updates
+ * If I would only get it right the first time I wouldn't have to do this
+ */
+ function update_332007() {
+
+ $sql = "ALTER TABLE `playlist_data` CHANGE `dyn_song` `dyn_song` TEXT NULL DEFAULT NULL";
+ $db_results = mysql_query($sql, dbh());
+
+ $this->set_version('db_version','332007');
+
+ } // update_332007
+
} // end update class
?>
diff --git a/song.php b/song.php
index 248cf490..6e8c02cf 100644
--- a/song.php
+++ b/song.php
@@ -50,6 +50,10 @@ switch ($action) {
if ($type == 'album') {
$song_ids = get_songs_from_type($type, $_POST['song'], $_REQUEST['artist_id']);
}
+ elseif ($_REQUEST['playlist_id']) {
+ $playlist = new Playlist($_REQUEST['playlist_id']);
+ $song_ids = $playlist->get_songs();
+ }
else {
$song_ids = $_POST['song'];
}