Re: [Rhythmbox-devel] rhythmdb.xml



On Wed, Jun 3, 2009 at 10:20 PM, Nguyen Thai Ngoc Duy <pclouds gmail com> wrote:
> On Wed, Jun 3, 2009 at 8:11 PM, s0rk <sork front ru> wrote:
>> Hey rhythmbox mailinglist,
>>
>> how can I disable the rescan of my music folder /rhythmdb.xml/.
>> Everytime I start RB it does this annoying rescan and take lots of
>> resources.
>> My db file is stored in ~.local/share/rhythmbox and has a size of 15 mb.
>
> Digging back rhythmbox history, there used to be --no-update for that,
> but it got lost in commit adc0170. Hmm..

You may want to try this patch. I'm not sure if it affects file
adding. But it stops initial stats for me.
-- 
Duy
diff --git a/rhythmdb/rhythmdb-private.h b/rhythmdb/rhythmdb-private.h
index aa125f7..c3eede7 100644
--- a/rhythmdb/rhythmdb-private.h
+++ b/rhythmdb/rhythmdb-private.h
@@ -63,6 +63,7 @@ enum {
 	RHYTHMDB_ENTRY_LAST_PLAYED_DIRTY = 4,
 	RHYTHMDB_ENTRY_FIRST_SEEN_DIRTY = 8,
 	RHYTHMDB_ENTRY_LAST_SEEN_DIRTY = 16,
+	RHYTHMDB_ENTRY_NO_STAT = 32,
 
 	/* the backend can use the top 16 bits for private flags */
 	RHYTHMDB_ENTRY_PRIVATE_FLAG_BASE = 65536,
diff --git a/rhythmdb/rhythmdb-tree.c b/rhythmdb/rhythmdb-tree.c
index d50ad07..d61442c 100644
--- a/rhythmdb/rhythmdb-tree.c
+++ b/rhythmdb/rhythmdb-tree.c
@@ -544,6 +544,7 @@ rhythmdb_tree_parser_end_element (struct RhythmDBTreeLoadContext *ctx,
 			g_mutex_lock (ctx->db->priv->entries_lock);
 			entry = g_hash_table_lookup (ctx->db->priv->entries, ctx->entry->location);
 			if (entry == NULL) {
+				ctx->entry->flags |= RHYTHMDB_ENTRY_NO_STAT;
 				rhythmdb_tree_entry_new_internal (RHYTHMDB (ctx->db), ctx->entry);
 				rhythmdb_entry_insert (RHYTHMDB (ctx->db), ctx->entry);
 				if (++ctx->batch_count == RHYTHMDB_QUERY_MODEL_SUGGESTED_UPDATE_CHUNK) {
diff --git a/rhythmdb/rhythmdb.c b/rhythmdb/rhythmdb.c
index 64f5b91..bf3c3e4 100644
--- a/rhythmdb/rhythmdb.c
+++ b/rhythmdb/rhythmdb.c
@@ -1315,7 +1315,8 @@ process_added_entries_cb (RhythmDBEntry *entry,
 		 * maybe it should be atomicised?
 		 */
 		g_mutex_lock (db->priv->stat_mutex);
-		if (db->priv->action_thread_running == FALSE) {
+		if (db->priv->action_thread_running == FALSE &&
+		    (!db->priv->no_update || !(entry->flags & RHYTHMDB_ENTRY_NO_STAT))) {
 			rhythmdb_add_to_stat_list (db, uri, entry,
 						   RHYTHMDB_ENTRY_TYPE_INVALID,
 						   RHYTHMDB_ENTRY_TYPE_IGNORE,


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