After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 604783 - last.fm integration (similar artists) broken
last.fm integration (similar artists) broken
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Last.fm
git master
Other Linux
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-16 23:01 UTC by Christian Krause
Modified: 2009-12-20 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to remove the lazy init of LastfmSourceContents (1.16 KB, patch)
2009-12-16 23:01 UTC, Christian Krause
needs-work Details | Review
Alternative patch as suggested by upstream (2.04 KB, patch)
2009-12-20 18:13 UTC, Christian Krause
committed Details | Review

Description Christian Krause 2009-12-16 23:01:58 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 1 Gabriel Burt 2009-12-16 23:07:49 UTC
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.
Comment 2 Christian Krause 2009-12-20 18:13:54 UTC
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?
Comment 3 Gabriel Burt 2009-12-20 21:02:27 UTC
Review of attachment 150114 [details] [review]:

Looks good, thanks Christian!