[banshee/gio-hardware] [AudioscrobblerService] Initialize the song start time
- From: Alex Launi <alexlauni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/gio-hardware] [AudioscrobblerService] Initialize the song start time
- Date: Fri, 13 Aug 2010 15:23:37 +0000 (UTC)
commit 9c79b3f9e8a72bc8cbb2cda2bdbca4eb6b4267c4
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]