If we remove a song from earlier in the playlist than the currently
playing song, we need to adjust the currently playing index accordingly. git-svn-id: https://samskivert.googlecode.com/svn/trunk@216 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
#
|
#
|
||||||
# $Id: musicd,v 1.10 2001/07/13 00:39:32 mdb Exp $
|
# $Id: musicd,v 1.11 2001/07/26 19:26:55 mdb Exp $
|
||||||
#
|
#
|
||||||
# MP3 audio server. Manages playlists of mp3 files that live on a local
|
# MP3 audio server. Manages playlists of mp3 files that live on a local
|
||||||
# filesystem. The playlists can be manipulated by connecting to the server
|
# filesystem. The playlists can be manipulated by connecting to the server
|
||||||
@@ -130,6 +130,8 @@ sub handle_client
|
|||||||
if ($playlist[$i]->[1] == $sid) {
|
if ($playlist[$i]->[1] == $sid) {
|
||||||
$sidx = $i;
|
$sidx = $i;
|
||||||
splice(@playlist, $i, 1);
|
splice(@playlist, $i, 1);
|
||||||
|
# adjust the playing index if necessary
|
||||||
|
$index -= 1 if ($i < $index);
|
||||||
last;
|
last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user