rpms/rhythmbox/F-8 rb-fix-lastfm-data-submission.patch, NONE, 1.1 rhythmbox.spec, 1.153, 1.154

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Tue Apr 1 15:34:28 UTC 2008


Author: hadess

Update of /cvs/pkgs/rpms/rhythmbox/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22619

Modified Files:
	rhythmbox.spec 
Added Files:
	rb-fix-lastfm-data-submission.patch 
Log Message:
* Tue Apr 01 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.3-10
- Add last.fm submission patch (#426046)


rb-fix-lastfm-data-submission.patch:

--- NEW FILE rb-fix-lastfm-data-submission.patch ---
--- rhythmbox-0.11.3.old/plugins/audioscrobbler/rb-audioscrobbler.c	2007-08-10 09:34:45.000000000 +0100
+++ rhythmbox-0.11.3/plugins/audioscrobbler/rb-audioscrobbler.c	2008-04-01 16:30:45.000000000 +0100
@@ -564,8 +564,8 @@ rb_audioscrobbler_add_to_queue (RBAudios
 static void
 maybe_add_current_song_to_queue (RBAudioscrobbler *audioscrobbler)
 {
+	gboolean got_elapsed;
 	guint elapsed;
-	int elapsed_delta;
 	AudioscrobblerEntry *cur_entry;
 
 	cur_entry = audioscrobbler->priv->currently_playing;
@@ -575,25 +575,30 @@ maybe_add_current_song_to_queue (RBAudio
 
 	rb_debug ("Adding currently playing song to queue");
 
-	rb_shell_player_get_playing_time (audioscrobbler->priv->shell_player, &elapsed, NULL);
-	elapsed_delta = elapsed - audioscrobbler->priv->current_elapsed;
-	audioscrobbler->priv->current_elapsed = elapsed;
-	
-	if ((elapsed >= cur_entry->length / 2 || elapsed >= 240) && elapsed_delta < 20) {
-		time (&cur_entry->play_time);
-		if (rb_audioscrobbler_add_to_queue (audioscrobbler, cur_entry)){
-			audioscrobbler->priv->currently_playing = NULL;
-		}
+	got_elapsed = rb_shell_player_get_playing_time (audioscrobbler->priv->shell_player,
+							&elapsed,
+							NULL);
+	if (got_elapsed) {
+		int elapsed_delta = elapsed - audioscrobbler->priv->current_elapsed;
+		audioscrobbler->priv->current_elapsed = elapsed;
 		
-		rb_audioscrobbler_preferences_sync (audioscrobbler);
-	} else if (elapsed_delta > 20) {
-		rb_debug ("Skipping detected; not submitting current song");
-		/* not sure about this - what if I skip to somewhere towards
-		 * the end, but then go back and listen to the whole song?
-		 */
-		audioscrobbler_entry_free (audioscrobbler->priv->currently_playing);
-		audioscrobbler->priv->currently_playing = NULL;
+		if ((elapsed >= cur_entry->length / 2 || elapsed >= 240) && elapsed_delta < 20) {
+			rb_debug ("Adding currently playing song to queue");
+			time (&cur_entry->play_time);
+			if (rb_audioscrobbler_add_to_queue (audioscrobbler, cur_entry)){
+				audioscrobbler->priv->currently_playing = NULL;
+			}
+			
+			rb_audioscrobbler_preferences_sync (audioscrobbler);
+		} else if (elapsed_delta > 20) {
+			rb_debug ("Skipping detected; not submitting current song");
+			/* not sure about this - what if I skip to somewhere towards
+			 * the end, but then go back and listen to the whole song?
+			 */
+			audioscrobbler_entry_free (audioscrobbler->priv->currently_playing);
+			audioscrobbler->priv->currently_playing = NULL;
 
+		}
 	}
 }
 
@@ -1274,6 +1279,7 @@ rb_audioscrobbler_song_changed_cb (RBShe
 				   RhythmDBEntry *entry,
 				   RBAudioscrobbler *audioscrobbler)
 {
+	gboolean got_time;
 	guint time;
 
 	if (audioscrobbler->priv->currently_playing != NULL) {
@@ -1285,11 +1291,17 @@ rb_audioscrobbler_song_changed_cb (RBShe
 		return;
 	}
 
-	rb_shell_player_get_playing_time (audioscrobbler->priv->shell_player,
-					  &time, NULL);
-	audioscrobbler->priv->current_elapsed = (int) time;
+	got_time = rb_shell_player_get_playing_time (audioscrobbler->priv->shell_player,
+						     &time,
+						     NULL);
+	if (got_time) {
+		audioscrobbler->priv->current_elapsed = (int) time;
+	} else {
+		rb_debug ("didn't get playing time; assuming 0");
+		audioscrobbler->priv->current_elapsed = 0;
+	}
 
-	if (rb_audioscrobbler_is_queueable (entry) && (time < 15)) {
+	if (rb_audioscrobbler_is_queueable (entry) && (got_time == FALSE || time < 15)) {
 		AudioscrobblerEntry *as_entry;
 		
 		/* even if it's the same song, it's being played again from


Index: rhythmbox.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rhythmbox/F-8/rhythmbox.spec,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -r1.153 -r1.154
--- rhythmbox.spec	17 Jan 2008 17:01:23 -0000	1.153
+++ rhythmbox.spec	1 Apr 2008 15:33:15 -0000	1.154
@@ -3,7 +3,7 @@
 Name: rhythmbox
 Summary: Music Management Application 
 Version: 0.11.3
-Release: 9%{?dist}
+Release: 10%{?dist}
 License: GPLv2+ and GFDL+
 Group: Applications/Multimedia
 URL: http://www.gnome.org/projects/rhythmbox/
@@ -59,6 +59,8 @@
 # http://bugzilla.gnome.org/show_bug.cgi?id=507450
 # http://svn.gnome.org/viewvc/rhythmbox?view=revision&revision=5455
 Patch5: rhythmbox-0.11.3-xfade-pause-deadlock.patch
+# http://bugzilla.gnome.org/show_bug.cgi?id=499745
+Patch6: rb-fix-lastfm-data-submission.patch
 
 %description
 Rhythmbox is an integrated music management application based on the powerful
@@ -94,6 +96,7 @@
 %patch3 -p1 -b .python-threading
 %patch4 -p0 -b .dont-disable-suspend
 %patch5 -p1 -b .xfade-pause-deadlocks
+%patch6 -p1 -b .lastfm-sub
 
 %build
 
@@ -205,6 +208,9 @@
 %{_libdir}/rhythmbox/plugins/upnp_coherence
 
 %changelog
+* Tue Apr 01 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.3-10
+- Add last.fm submission patch (#426046)
+
 * Thu Jan 17 2008 - Bastien Nocera <bnocera at redhat.com> - 0.11.3-9
 - Own the plugins directory (#389111)
 




More information about the fedora-extras-commits mailing list