[banshee] [AudioscrobblerService] Initialize the song start time



commit f8fd8b986339a09d6132219e8b1a2862247fd90d
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Thu Aug 5 22:27:16 2010 +0200

    [AudioscrobblerService] Initialize the song start time
    
    If the scrobbling engine misses the first StartOfStream event,
    for example because it was not started yet, the song start time
    was not initialized. We would then try to scrobble the track with a
    negative value as start time. This ended up blocking the whole
    scrobbling queue.
    
    This commit just sets a reasonable default value for the start time.
    Fixes bgo#553433.

 .../AudioscrobblerService.cs                       |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs
index 83821cc..1842642 100644
--- a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs
+++ b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Audioscrobbler/AudioscrobblerService.cs
@@ -94,6 +94,9 @@ namespace Banshee.Lastfm.Audioscrobbler
             LastfmCore.AudioscrobblerQueue = queue;
             connection = LastfmCore.Audioscrobbler;
 
+            // Initialize with a reasonable value in case we miss the first StartOfStream event
+            song_start_time = DateTime.Now;
+
             Network network = ServiceManager.Get<Network> ();
             connection.UpdateNetworkState (network.Connected);
             network.StateChanged += HandleNetworkStateChanged;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]