GNOME Bugzilla – Bug 604783
last.fm integration (similar artists) broken
Last modified: 2009-12-20 21:02:46 UTC
Created attachment 149884 [details] [review] patch to remove the lazy init of LastfmSourceContents When playing music the "similar artists" in the context pane is never updated and on the console the following exception is reported: [Warn 23:29:10.538] Caught an exception - Lastfm.Data.DataCore.CachePath and/or Lastfm.Data.DataCore.Useragent are null. Applications must set this value. (in `Lastfm') at Lastfm.Data.DataCore.Initialize () [0x00000] at Lastfm.Data.LastfmData`1[Lastfm.Data.SimilarArtist]..ctor (System.String dataUrlFragment, CacheDuration cacheDuration, System.String xpath) [0x00000] at Lastfm.Data.LastfmData`1[Lastfm.Data.SimilarArtist]..ctor (System.String dataUrlFragment, System.String xpath) [0x00000] at Lastfm.Data.LastfmArtistData.Get[SimilarArtist] (System.String fragment, System.String xpath) [0x00000] at Lastfm.Data.LastfmArtistData.Get[SimilarArtist] (System.String fragment) [0x00000] at Lastfm.Data.LastfmArtistData.get_SimilarArtists () [0x00000] at Banshee.Lastfm.Recommendations.RecommendationPane.UpdateForArtist (System.String artist) [0x00000] How to reproduce: - enable Last.fm Radio and Scrobbling extension - enable Context pane - listen to music Bug fix: - the bug was introduced as side effect of commit 3dceca235edc22088babf3d7dc3e9f9f934cef4f where lots of objects were changed to be initialized lazily - this caused that the static contructor of LastfmSourceContents was not executed and so DataCore.UserAgent/CachePath were not set accordingly I've attached a patch which changes the initialization of LastfmSourceContents back to non-lazily.
Comment on attachment 149884 [details] [review] patch to remove the lazy init of LastfmSourceContents Instead of getting rid of the lazy loading for the GUI, just pull those two DataCore calls out into the LastfmSource ctor itself - right above or below the lazy prop call.
Created attachment 150114 [details] [review] Alternative patch as suggested by upstream I've changed the patch according to your suggestion. I have also removed the static constructor completely - otherwise it is misleading. I've tested the patch and it works fine, too. Please can you review the 2nd patch?
Review of attachment 150114 [details] [review]: Looks good, thanks Christian!