[Banshee-List] Can't get Banshee's CollectionIndexer to work



Hi, I'm trying to use the CollectionIndexer to create the uPnP
MediaServer part of GSoC but I just can't seem to get it to work. I've
read through both tangerine's and gnome-do's code (which both works
for me) but the simple example I made just don't want to work. I'm
sure I have done something wrong but can't find it, if anyone could
spot it they'd help me immensely :)

I have attached the code I use and I have tried referencing both the
.dll from gnome-do and one built from my mono-gsoc branch (should be
quite recent).

What I see in terminal when running it is:
Hello World!
[Debug 18:17:13.454] Acquiring org.freedesktop.DBus session instance
[Debug 18:17:13.624] org.bansheeproject.CollectionIndexer is already started
[Debug 18:17:13.625] Resolving
org.bansheeproject.CollectionIndexer.Service (attempt 1)
[Debug 18:17:13.627] Connected to org.bansheeproject.CollectionIndexer.Service
[Debug 18:17:13.627] Listening to service's CollectionChanged signal
(full-app is running)
CollectionCount
[Debug 18:17:13.636] Creating an ICollectionIndexer
(/org/bansheeproject/Banshee/CollectionIndexerService/CollectionIndexer_1)
Indexer started

And as you can see CollectionCount and OnStart is called, nothing
more. I have waited with it active for hours and tried to start, re
scan library and stop banshee while it running with no result.

Cheers,
Tobias
using System;

using Banshee.Collection.Indexer.RemoteHelper;

namespace TestCollectionIndexer
{
	class MainClass : SimpleIndexerClient
	{
		int count;
		DateTime last_change;
		
		readonly string[] export_fields = new [] {"name", "artist", "year", "album", "local-path", "URI", "media-attributes", "artwork-id", "track-number"};
		
		public MainClass()
		{
			count = 0;
			last_change = DateTime.MinValue;
			
			AddExportField (export_fields);
			IndexWhenCollectionChanged = false;
		}
		
		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello World!");
			MainClass mc = new MainClass();
			mc.Start();
			
			Console.ReadLine();
		}
		
		#region implemented abstract members of Banshee.Collection.Indexer.RemoteHelper.SimpleIndexerClient
		protected override void IndexResult (System.Collections.Generic.IDictionary<string, object> result)
		{
			Console.WriteLine ("IndexResult");
		}
		
		protected override void OnStarted ()
		{
			Console.WriteLine ("Indexer started");
		}

		protected override void OnBeginUpdateIndex ()
		{
			Console.WriteLine ("Reading Banshee index results from DBus");
		}
		
		protected override void OnEndUpdateIndex ()
		{
			Console.WriteLine ("OnEndUpdateIndex");
		}
		
		protected override void OnShutdownWhileIndexing ()
		{
			Console.WriteLine("OnShutdownWhileIndexing");
		}
		
		protected override int CollectionCount {
			get { Console.WriteLine("CollectionCount"); return count; }
		}
		
		
		protected override DateTime CollectionLastModified {
			get { Console.WriteLine("CollectionLastModified"); return last_change; }
		}
		
		#endregion
	}
}


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