diff options
author | Phil Trimble <PhilTrimble@gmail.com> | 2013-03-16 21:15:13 +0000 |
---|---|---|
committer | Andres G. Aragoneses <knocte@gmail.com> | 2013-03-16 21:15:13 +0000 |
commit | f0fcf24ea69b79aa1fb6aca6b3ccccf0ddbac50f (patch) | |
tree | e0427194abc87743f6127a6386de31ac030285d0 | |
parent | d16f8ef6b27d76f43783091defce3d6990327dba (diff) |
Lastfm: avoid unnecessary wait when submitting successful scrobbles
In the case where everything was successful but there are still entries in
the queue to submit, the overall connection state was set to 'Idle'.
This meant that on the next interval we would realize that we had tracks to
submit and then set the state to 'NeedTransmit'. This was an unnecessary
interval step and made Banshee wait a bit before attempting to submit the
rest of the queue.
Signed-off-by: Andres G. Aragoneses <knocte@gmail.com>
-rw-r--r-- | src/Libraries/Lastfm/Lastfm/AudioscrobblerConnection.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Libraries/Lastfm/Lastfm/AudioscrobblerConnection.cs b/src/Libraries/Lastfm/Lastfm/AudioscrobblerConnection.cs index 03a192c10..dcad8886d 100644 --- a/src/Libraries/Lastfm/Lastfm/AudioscrobblerConnection.cs +++ b/src/Libraries/Lastfm/Lastfm/AudioscrobblerConnection.cs @@ -314,7 +314,11 @@ namespace Lastfm queue.RemoveRange (0, nb_tracks_scrobbled); queue.Save (); - state = State.Idle; + if (queue.Count > 0) { + state = State.NeedTransmit; + } else { + state = State.Idle; + } } else { // TODO: If error == StationError.InvalidSessionKey, // suggest to the user to (re)do the Last.fm authentication. |