From 653347e6b83cfd2581b6223af9766934db4feeba Mon Sep 17 00:00:00 2001 From: mdb Date: Thu, 26 Jul 2001 19:26:55 +0000 Subject: [PATCH] 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 --- projects/robodj/bin/musicd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/robodj/bin/musicd b/projects/robodj/bin/musicd index ffae20c0..314213eb 100755 --- a/projects/robodj/bin/musicd +++ b/projects/robodj/bin/musicd @@ -1,6 +1,6 @@ #!/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 # filesystem. The playlists can be manipulated by connecting to the server @@ -130,6 +130,8 @@ sub handle_client if ($playlist[$i]->[1] == $sid) { $sidx = $i; splice(@playlist, $i, 1); + # adjust the playing index if necessary + $index -= 1 if ($i < $index); last; } }