Index: rb-psp-source.c
===================================================================
--- rb-psp-source.c	(revision 6053)
+++ rb-psp-source.c	(working copy)
@@ -47,7 +47,7 @@
 #include "rb-debug.h"
 #include "rb-util.h"
 #include "rb-file-helpers.h"
-#include "rb-auto-playlist-source.h"
+#include "rb-static-playlist-source.h"
 #include "rhythmdb.h"
 #include "rb-plugin.h"
 
@@ -190,19 +190,57 @@
 }
 
 static void
+add_playlist_entries (RhythmDB *db, RBSource *playlist, GFile *playlist_dir)
+{
+	GFileEnumerator *e;
+	GFileInfo *info;
+
+	e = g_file_enumerate_children (playlist_dir, G_FILE_ATTRIBUTE_STANDARD_NAME","G_FILE_ATTRIBUTE_STANDARD_TYPE,
+				       G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	if (e == NULL)
+		return;
+
+	while ((info = g_file_enumerator_next_file (e, NULL, NULL)) != NULL) {
+		GFile *file;
+		RhythmDBEntry *entry;
+		const char *name;
+		char *uri;
+
+		if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) {
+			g_object_unref (info);
+			continue;
+		}
+		name = g_file_info_get_name (info);
+		file = g_file_resolve_relative_path (playlist_dir, name);
+
+		uri = g_file_get_uri (file);
+		g_message ("loading %s", uri);
+		entry = rhythmdb_entry_lookup_by_location (db, uri);
+		g_free (uri);
+
+		if (entry != NULL) {
+			rb_static_playlist_source_add_entry (RB_STATIC_PLAYLIST_SOURCE (playlist), entry, -1);
+			g_object_unref (entry);
+		} else {
+			//FIXME
+			//rhythmdb_entry_new (db, );
+		}
+		g_object_unref (info);
+	}
+
+	g_object_unref (e);
+}
+
+static void
 visit_playlist_dirs (RBPspSource *source,
 		     GFile *file)
 {
 	RBShell *shell;
 	RhythmDB *db;
 	RhythmDBEntryType entry_type;
-	char *playlist_path;
 	char *playlist_name;
 	RBSource *playlist;
-	GPtrArray *query;
 
-	playlist_path = g_file_get_uri (file);		/* or _get_path? */
-
 	g_object_get (source,
 		      "shell", &shell,
 		      "entry-type", &entry_type,
@@ -211,25 +249,17 @@
 		      "db", &db,
 		      NULL);
 
-	/* FIXME this isn't good enough, we only need the files directly under the playlist directory,
-	 * not sub-dirs */
-	query = rhythmdb_query_parse (db,
-				      RHYTHMDB_QUERY_PROP_EQUALS, RHYTHMDB_PROP_TYPE, entry_type,
-				      RHYTHMDB_QUERY_PROP_PREFIX, RHYTHMDB_PROP_LOCATION, playlist_path,
-				      RHYTHMDB_QUERY_END);
-	g_free (playlist_path);
-        g_boxed_free (RHYTHMDB_TYPE_ENTRY_TYPE, entry_type);
-
+	/* Create the playlist */
 	playlist_name = g_file_get_basename (file);
-	playlist = rb_auto_playlist_source_new (shell, playlist_name, FALSE);
+	playlist = rb_static_playlist_source_new (shell, playlist_name, NULL, FALSE, entry_type);
 	g_free (playlist_name);
+        g_boxed_free (RHYTHMDB_TYPE_ENTRY_TYPE, entry_type);
 
-	rb_auto_playlist_source_set_query (RB_AUTO_PLAYLIST_SOURCE (playlist), query,
-					   RHYTHMDB_QUERY_MODEL_LIMIT_NONE, NULL,
-					   NULL, 0);
 	rb_generic_player_source_add_playlist (RB_GENERIC_PLAYER_SOURCE (source), shell, RB_SOURCE (playlist));
-	rhythmdb_query_free (query);
 
+	/* Add entries */
+	add_playlist_entries (db, playlist, file);
+
 	g_object_unref (shell);
 	g_object_unref (db);
 }
