From: Anant N. <an...@ki...> - 2006-11-30 17:52:22
|
-- Resending message because it seems some SPAM got attached to my previous one... -- Hi Todd! > I see that lastfm_add_track() is called from file_itunesdb.c when an > ipod is connected and the database is imported. But looking at > lastfm_add_track() in lastfm.c, it doesn't appear to actually do > anything other than set some variables. So this is how it works: lastfm_add_track() only adds the track to the lastfm cache. It is lastfm_send_request() that actually sends all the tracks in the cache to the audioscrobbler web service (or atleast it tries to). As you have rightly noted; lastfm_send_request() _must_ be called for the tracks to be submitted, and in my local repository, I see it mentioned in gp_load_ipods() [file_itunesdb.c] because it must be called right after all the itunesDBs have been loaded. And, it must be called only _once_ during a particular session (you get GIO errors because lastfm_send_request() has a call to curl_init() which a function that must not be called several times in a row!). If an active internet connection is not available or the tracks are not submitted for some reason; it is kept in the cache and the operation is retried the next time. I wonder why that call didn't make it to CVS, I think the patches I sent to Jorg were b0rked. Anyway, that's where it should be; but I'll put a little more thought into this. I have my examinations (again! :() right now, but I'll be free 6th Dec onwards when I'll take a good look at it again. Thanks for reporting this. Feel free to let me know if you have any suggestions regarding this. Jorg: If you're planning to make a release of gtkpod soon, I would prefer that the lastfm patch isn't included until I sort it out fully; sometime in mid-december :) Cheers, Anant |
From: Todd Z. <tm...@po...> - 2006-11-30 19:04:13
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Anant, Anant Narayanan wrote: > Hi Todd! > >> I see that lastfm_add_track() is called from file_itunesdb.c when an >> ipod is connected and the database is imported. But looking at >> lastfm_add_track() in lastfm.c, it doesn't appear to actually do >> anything other than set some variables. > > So this is how it works: lastfm_add_track() only adds the track to the > lastfm cache. It is lastfm_send_request() that actually sends all the > tracks in the cache to the audioscrobbler web service (or atleast it > tries to). > > As you have rightly noted; lastfm_send_request() _must_ be called for > the tracks to be submitted, and in my local repository, I see it > mentioned in gp_load_ipods() [file_itunesdb.c] because it must be > called right after all the itunesDBs have been loaded. And, it must > be called only _once_ during a particular session (you get GIO errors > because lastfm_send_request() has a call to curl_init() which a > function that must not be called several times in a row!). If an > active internet connection is not available or the tracks are not > submitted for some reason; it is kept in the cache and the operation > is retried the next time. > > I wonder why that call didn't make it to CVS, I think the patches I > sent to Jorg were b0rked. Anyway, that's where it should be; but I'll > put a little more thought into this. I have my examinations (again! > :() right now, but I'll be free 6th Dec onwards when I'll take a good > look at it again. Cool, good luck. > Thanks for reporting this. Feel free to let me know if you have any > suggestions regarding this. I'll definitely try it out. Right now I'm using a script to scrobble the tracks on my ipod and I have to take care to run it before I run gtkpod. The script parses the Play Counts file which gtkpod will move to Play Counts.bak whenever it writes to the ipod. So having this integrated will save me a few mental steps. :) One minor thing I notice is that curl is required to make the Last.FM support functional and there are #ifdef HAVE_CURL statements in the code to effect this. But regardless of whether curl is available at build time or not the Last.FM tab will be displayed in the preferences. I'm not sure what the best way to handle that is, but it seems like it would be best to not display the tab if gtkpod isn't built with curl support. Let me know when you get time to work on this and maybe by then I'll have some better ideas. Thanks for the code! - -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ====================================================================== The distinction between Freedom and Liberty is not accurately known; naturalists have been unable to find a living specimen of either. -- Ambrose Bierce -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iQFDBAEBAgAtBQJFbysgJhhodHRwOi8vd3d3LnBvYm94LmNvbS9+dG16L3BncC90 bXouYXNjAAoJEEMlk4u+rwzjV6oIAKi/RU1DJkSDCTb2bG6nncUiPk+E6DWnNwsC TEsv4N+g2HTzzBewAwOtSp/6iJgrvS0M6FR+tmrF5RH3bFD7KFOJNai8AgU9xD1L DIFONMI8jCDE0ideSnS5ghdeMbfBifV2PHE6BRlwxkjkSzTlOW88epjdI3q6DpI4 EZuIxyYFPk6S780VPMdiKWEz0PEFjrFmtOloMy1E+9bUQC7ItBA20Kt4rOnScI6a 0Y/h5EXwKZV3feaenUcwwvclOgaKO+4eWybQaWipdUNK3fWOaeSU8c/8ciaMtDyx AQ05l/7nt0dCCQQ9yqM4EsLKhn6J4OH5JNEOpFlg4rTsucKe79o= =QvsH -----END PGP SIGNATURE----- |
From: Anant N. <an...@ki...> - 2006-11-30 19:39:54
|
> One minor thing I notice is that curl is required to make the Last.FM > support functional and there are #ifdef HAVE_CURL statements in the > code to effect this. But regardless of whether curl is available at > build time or not the Last.FM tab will be displayed in the > preferences. I'm not sure what the best way to handle that is, but it > seems like it would be best to not display the tab if gtkpod isn't > built with curl support. An excellent suggestion, I will remember to #ifdef the preferences tab out :) Thanks, Anant |