diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-11 03:41:50 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-09-11 03:41:50 +0000 |
commit | 87c3f8292fd158329cf1abecca6e651a22a7ee89 (patch) | |
tree | 1f739db8f9bfefaef035053585c3edfdac828c50 /lib | |
parent | a3a07028fb45e9ebc0c741853f3e2b838f03bd12 (diff) | |
download | ampache-87c3f8292fd158329cf1abecca6e651a22a7ee89.tar.gz ampache-87c3f8292fd158329cf1abecca6e651a22a7ee89.tar.bz2 ampache-87c3f8292fd158329cf1abecca6e651a22a7ee89.zip |
fixed up some playlist snafus now appends to playlist and remembers last used
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/playlist.class.php | 13 | ||||
-rw-r--r-- | lib/playlist.lib.php | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php index ec5f70b6..866e8ba8 100644 --- a/lib/class/playlist.class.php +++ b/lib/class/playlist.class.php @@ -319,11 +319,20 @@ class Playlist { */ function add_songs($song_ids=array()) { + /* We need to pull the current 'end' track and then use that to + * append, rather then integrate take end track # and add it to + * $song->track add one to make sure it really is 'next' + */ + $sql = "SELECT `track` FROM playlist_data WHERE `playlist`='" . $this->id . "' ORDER BY `track` DESC LIMIT 1"; + $db_results = mysql_query($sql, dbh()); + $data = mysql_fetch_assoc($db_results); + $base_track = $data['track']; + foreach ($song_ids as $song_id) { /* We need the songs track */ $song = new Song($song_id); - - $track = sql_escape($song->track); + + $track = sql_escape($song->track+$base_track); $id = sql_escape($song->id); $pl_id = sql_escape($this->id); diff --git a/lib/playlist.lib.php b/lib/playlist.lib.php index 567391db..fdf6ec4c 100644 --- a/lib/playlist.lib.php +++ b/lib/playlist.lib.php @@ -64,6 +64,11 @@ function show_playlist($playlist) { /* Create the Playlist */ $song_ids = $playlist->get_items(); + /* Store this new id in the session for later + * use + */ + $_SESSION['data']['playlist_id'] = $playlist->id; + show_playlist_menu(); if (count($song_ids) > 0) { |