commit:06597fcf0415656ae3430298fbdcf6e4faa0bc4d
author:Chip Black
committer:Chip Black
date:Wed Oct 1 04:48:51 2008 -0500
parents:3d39b148f0bbe3e6578ded3b79221acb0eae1f38
ut-party-add now keeps already played songs in the playlist, only
shuffling new entries and entries yet to be played
diff --git a/omake/ut-party-add b/omake/ut-party-add
line changes: +3/-9
index f034d10..4c743c8
--- a/omake/ut-party-add
+++ b/omake/ut-party-add
@@ -9,15 +9,14 @@ chomp(my $pid = <PID>);
 close PID;
 
 open CURRENT, "$uthome/current";
-my $current = <CURRENT> + 0;
+my $current = <CURRENT> + 1;
 close CURRENT;
+print "$current\n";
 
 open PLAYLIST, "$uthome/playlist";
-scalar <PLAYLIST> while $current--;
-my $current = <PLAYLIST>;
 
 open NEWPLAYLIST, ">$uthome/playlist.new";
-print NEWPLAYLIST $current;
+print NEWPLAYLIST scalar <PLAYLIST> while $current--;
 close NEWPLAYLIST;
 
 open NEWPLAYLIST, "| shuffle >>$uthome/playlist.new";
@@ -29,11 +28,6 @@ close PLAYLIST;
 
 rename "$uthome/playlist.new", "$uthome/playlist";
 
-open CURRENT, ">$uthome/current";
-print CURRENT "0 $current\n";
-close CURRENT;
-
 if ($pid) {
-	print "$pid\n";
 	kill SIGUSR1, $pid;
 }