[rhythmbox] generic-player: don't search for playlists unnecessarily (bug #583934)



commit 0c9d36ecc5d8866e69cdbadbe29495fc243e9817
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun May 31 23:02:48 2009 +1000

    generic-player: don't search for playlists unnecessarily (bug #583934)
    
    If we don't have any information at all about playlist support, there's
    no need to go searching the entire device for playlists.
---
 plugins/generic-player/rb-generic-player-source.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/plugins/generic-player/rb-generic-player-source.c b/plugins/generic-player/rb-generic-player-source.c
index 5d3e8d6..22b1bd3 100644
--- a/plugins/generic-player/rb-generic-player-source.c
+++ b/plugins/generic-player/rb-generic-player-source.c
@@ -1156,13 +1156,18 @@ default_load_playlists (RBGenericPlayerSource *source)
 		 */
 		playlist_path = rb_uri_append_path (mount_path, priv->playlist_path);
 		rb_debug ("constructed playlist search path %s", playlist_path);
-
+	} else {
+		playlist_path = g_strdup (mount_path);
 	}
 
-	rb_uri_handle_recursively (playlist_path ? playlist_path : mount_path,
-				   NULL,
-				   (RBUriRecurseFunc) visit_playlist_dirs,
-				   source);
+	/* if we don't have any information about playlist support, don't go looking for playlists */
+	if (priv->playlist_path != NULL || priv->playlist_format_unknown == FALSE) {
+		rb_debug ("searching for playlists in %s", playlist_path);
+		rb_uri_handle_recursively (playlist_path,
+					   NULL,
+					   (RBUriRecurseFunc) visit_playlist_dirs,
+					   source);
+	}
 
 	g_free (playlist_path);
 	g_free (mount_path);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]