[rhythmbox] audioscrobbler: allow a force update of user data
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] audioscrobbler: allow a force update of user data
- Date: Tue, 21 Sep 2010 10:55:58 +0000 (UTC)
commit 59bec7c46bd1d810a0602771f5553149de000034
Author: Jamie Nicol <jamie thenicols net>
Date: Fri Sep 10 11:56:07 2010 +0100
audioscrobbler: allow a force update of user data
rb_audioscrobbler_user_force_update sends new requests without first
checking for valid cached responses. The refresh profile action will
call this function instead of rb_audioscrobbler_user_update.
.../rb-audioscrobbler-profile-source.c | 2 +-
plugins/audioscrobbler/rb-audioscrobbler-user.c | 14 ++++++++++++++
plugins/audioscrobbler/rb-audioscrobbler-user.h | 1 +
3 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
index 28221ba..0982c79 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-profile-source.c
@@ -1073,7 +1073,7 @@ download_track_batch_complete_cb (RBTrackTransferBatch *batch,
static void
refresh_profile_action_cb (GtkAction *action, RBAudioscrobblerProfileSource *source)
{
- rb_audioscrobbler_user_update (source->priv->user);
+ rb_audioscrobbler_user_force_update (source->priv->user);
}
void
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-user.c b/plugins/audioscrobbler/rb-audioscrobbler-user.c
index d8a285b..81f5889 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-user.c
+++ b/plugins/audioscrobbler/rb-audioscrobbler-user.c
@@ -535,6 +535,20 @@ rb_audioscrobbler_user_update (RBAudioscrobblerUser *user)
}
}
+void
+rb_audioscrobbler_user_force_update (RBAudioscrobblerUser *user)
+{
+ if (user->priv->username != NULL) {
+ rb_debug ("forcing update of user data");
+ request_user_info (user);
+ request_recent_tracks (user, 15);
+ request_top_tracks (user, 15);
+ request_loved_tracks (user, 15);
+ request_top_artists (user, 15);
+ request_recommended_artists (user, 15);
+ }
+}
+
static void
load_from_cache (RBAudioscrobblerUser *user)
{
diff --git a/plugins/audioscrobbler/rb-audioscrobbler-user.h b/plugins/audioscrobbler/rb-audioscrobbler-user.h
index fbd9120..6b6d176 100644
--- a/plugins/audioscrobbler/rb-audioscrobbler-user.h
+++ b/plugins/audioscrobbler/rb-audioscrobbler-user.h
@@ -95,6 +95,7 @@ void rb_audioscrobbler_user_set_authentication_details (RBAudioscrobblerUser *us
const char *session_key);
void rb_audioscrobbler_user_update (RBAudioscrobblerUser *user);
+void rb_audioscrobbler_user_force_update (RBAudioscrobblerUser *user);
void rb_audioscrobbler_user_love_track (RBAudioscrobblerUser *user,
const char *title,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]