From f69359f894a89c728d8951dee115033a953a104c Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sat, 9 Aug 2008 13:11:05 +0100 Subject: [PATCH] Don't reset played so far counter when queue rearranges (!) Organization: Straylight/Edgeware From: Richard Kettlewell --- disobedience/queue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/disobedience/queue.c b/disobedience/queue.c index db013d3..72da908 100644 --- a/disobedience/queue.c +++ b/disobedience/queue.c @@ -40,7 +40,8 @@ static void playing_completed(void *v, /** @brief Called when either the actual queue or the playing track change */ static void queue_playing_changed(void) { - + const char *old_id = playing_track ? playing_track->id : 0; + /* Check that the playing track isn't in the queue. There's a race here due * to the fact that we issue the two commands at slightly different times. * If it goes wrong we re-issue and try again, so that we never offer up an @@ -66,7 +67,8 @@ static void queue_playing_changed(void) { playing_track = NULL; q = actual_queue; } - time(&last_playing); /* for column_length() */ + if(!old_id || !playing_track || strcmp(old_id, playing_track->id)) + time(&last_playing); /* for column_length() */ ql_new_queue(&ql_queue, q); /* Tell anyone who cares */ event_raise("queue-list-changed", q); -- [mdw]