summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG11
-rw-r--r--lib/class/playlist.class.php13
-rw-r--r--lib/playlist.lib.php5
-rw-r--r--playlist.php4
-rw-r--r--templates/show_play_selected.inc.php2
5 files changed, 28 insertions, 7 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index b84ae7b3..5c88f2b5 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,16 +4,19 @@
--------------------------------------------------------------------------
v.3.3.2
+ - When adding to a playlist by default it 'appends' rather then
+ integrating (Thx Salguod)
+ - Now Remembers the Last used playlist correctly. (Thx Salguod)
- Cleaned up some Formating issues with the Access control
- interface
+ interface.
- Fixed an issue with the MPD Controller not passing the password
to the MPD class causing flames to shoot out if your MPD
- had a password set
+ had a password set.
- Fixed issue with transcoding not changing the mime type or the
- filename, currently hardcodes to mp3 and audio/mpeg
+ filename, currently hardcodes to mp3 and audio/mpeg.
- Updated Spanish Translation (Thx Bgordon)
- Fixed potential for a foreach() error on vainfo if no tags are
- found, and fixed quicktime (mp4) tag reading
+ found, and fixed quicktime (mp4) tag reading.
- Fixed the CSS for now playing, with multiple entries it turned
into modern art.
- Fixed issue with Keywords search that cropped up when I removed
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) {
diff --git a/playlist.php b/playlist.php
index f70bcd18..7e8fcd82 100644
--- a/playlist.php
+++ b/playlist.php
@@ -86,6 +86,8 @@ switch ($action) {
/* Show the Playlist */
$_REQUEST['playlist_id'] = $playlist->id;
+ /* Store this new id in the session for later use */
+ $_SESSION['data']['playlist_id'] = $playlist->id;
show_playlist($playlist);
break;
case 'add_dyn_song':
@@ -96,6 +98,7 @@ switch ($action) {
}
$playlist->add_dyn_song();
+ $_SESSION['data']['playlist_id'] = $playlist->id;
show_playlist($playlist);
break;
case 'create_playlist':
@@ -110,6 +113,7 @@ switch ($action) {
$playlist_type = scrub_in($_REQUEST['type']);
$playlist->create($playlist_name,$playlist_type);
+ $_SESSION['data']['playlist_id'] = $playlist->id;
show_confirmation(_('Playlist Created'),$playlist_name . ' (' . $playlist_type . ') ' . _(' has been created'),'playlist.php');
break;
case 'edit':
diff --git a/templates/show_play_selected.inc.php b/templates/show_play_selected.inc.php
index 9b44e8a0..31ec04fc 100644
--- a/templates/show_play_selected.inc.php
+++ b/templates/show_play_selected.inc.php
@@ -45,7 +45,7 @@ if (is_object($GLOBALS['playlist'])) { ?>
<tr align="center">
<td colspan="2">
<?php echo _('Playlist'); ?>: <input type="button" value="<?php echo _('Add to'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=add_to');" />
- <?php show_playlist_dropdown($GLOBALS['playlist_id']); ?>
+ <?php show_playlist_dropdown($_SESSION['data']['playlist_id']); ?>
<input class="button" type="button" value="<?php echo _('View'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=view');" />
<input class="button" type="button" value="<?php echo _('Edit'); ?>" onclick="return SubmitToPage('songs','<?php echo $web_path; ?>/playlist.php?action=edit');" />
</td>