[banshee] [Last.fm] Fix bug breaking recs and scrobbling



commit 8010f6da9f5d5433721554b86fbde2ec2af1e56f
Author: Christian Krause <chkr plauener de>
Date:   Sun Dec 20 13:00:07 2009 -0800

    [Last.fm] Fix bug breaking recs and scrobbling
    
    With the lazy-loaded GUI patch of mine from a few weeks ago, the
    Lastfm.DataCore properties were getting initialized only when the GUI
    was loaded (eg the user clicked on the Last.fm source), but recs and
    scrobbling depended on that and were broken (BGO #604783)
    
    Signed-off-by: Gabriel Burt <gabriel burt gmail com>

 .../Banshee.Lastfm.Radio/LastfmSource.cs           |    5 +++++
 .../Banshee.Lastfm.Radio/LastfmSourceContents.cs   |    5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
index 06546f9..98ac90b 100644
--- a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
+++ b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSource.cs
@@ -34,6 +34,7 @@ using Mono.Unix;
 
 using Lastfm;
 using Lastfm.Gui;
+using Lastfm.Data;
 using Hyena.Data;
 
 using Banshee.Base;
@@ -105,6 +106,10 @@ namespace Banshee.Lastfm.Radio
             Properties.SetString ("SortChildrenActionLabel", Catalog.GetString ("Sort Stations by"));
             Properties.Set<LastfmColumnController> ("TrackView.ColumnController", new LastfmColumnController ());
 
+            // Initialize DataCore's UserAgent and CachePath
+            DataCore.UserAgent = Banshee.Web.Browser.UserAgent;
+            DataCore.CachePath = System.IO.Path.Combine (Banshee.Base.Paths.ExtensionCacheRoot, "lastfm");
+
             // FIXME this is temporary until we split the GUI part from the non-GUI part
             Properties.Set<ISourceContents> ("Nereid.SourceContents", new LazyLoadSourceContents<LastfmSourceContents> ());
             Properties.Set<bool> ("Nereid.SourceContents.HeaderVisible", false);
diff --git a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSourceContents.cs b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSourceContents.cs
index 5a19fa9..902503d 100644
--- a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSourceContents.cs
+++ b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/LastfmSourceContents.cs
@@ -31,11 +31,6 @@ namespace Banshee.Lastfm.Radio
 
         private Viewport viewport;
 
-        static LastfmSourceContents () {
-            DataCore.UserAgent = Banshee.Web.Browser.UserAgent;
-            DataCore.CachePath = System.IO.Path.Combine (Banshee.Base.Paths.ExtensionCacheRoot, "lastfm");
-        }
-
         // "Coming Soon: Profile, Friends, Events etc")
         public LastfmSourceContents () : base ()
         {



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