From: Richard Kettlewell Date: Sat, 9 Aug 2008 12:11:05 +0000 (+0100) Subject: Don't reset played so far counter when queue rearranges (!) X-Git-Tag: 4.3~78 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/f69359f894a89c728d8951dee115033a953a104c Don't reset played so far counter when queue rearranges (!) --- 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);