? big-patch.patch
? Util/entagged-sharp
Index: BeagleClient/Hit.cs
===================================================================
RCS file: /cvs/gnome/beagle/BeagleClient/Hit.cs,v
retrieving revision 1.14
diff -u -r1.14 Hit.cs
--- BeagleClient/Hit.cs	15 Jan 2005 05:35:00 -0000	1.14
+++ BeagleClient/Hit.cs	8 Feb 2005 23:41:36 -0000
@@ -96,9 +96,12 @@
 
 			writer.Write (properties.Count);
 			foreach (string key in properties.Keys) {
-				string value = (string) properties[key];
+				IList values = properties[key] as IList;
 				writer.Write (key);
-				writer.Write (value);
+				writer.Write (values.Count);
+				foreach(string value in values) {
+					writer.Write (value);
+				}
 			}
 
 			writer.Write (data.Count);
@@ -128,9 +131,12 @@
 			int numProps = reader.ReadInt32 ();
 			for (int i = 0; i < numProps; i++) {
 				string key = reader.ReadString ();
-				string value = reader.ReadString ();
-
-				hit[key] = value;
+				
+				int numValues = reader.ReadInt32 ();
+				for(int j = 0; j < numValues; j++) {
+					string value = reader.ReadString ();
+					hit.AddValueToProperty(key, value);
+				}
 			}
 
 			int numData = reader.ReadInt32 ();
@@ -290,17 +296,40 @@
 		}
 
 		virtual public string this [string key] {
-			get { return (string) properties [key]; }
+			get {
+				IList props = properties [key] as IList;
+				if(props == null || props.Count == 0)
+					return null;
+				
+				return props[0] as string;
+			}
 			set { 
 				if (value == null || value == "") {
 					if (properties.Contains (key))
 						properties.Remove (key);
 					return;
 				}
-				properties [key] = value as string;
+				
+				IList props = new ArrayList();
+				props.Add(value as string);
+				properties [key] = props;
 			}
 		}
 
+		public void AddValueToProperty (string key, string value) {
+			IList props = properties [key] as IList;
+			if(props == null) {
+				this [key] = value;
+				return;
+			}
+			
+			props.Add(value);				
+		}
+		
+		public IList GetValuesForProperty (string key) {
+			return properties [key] as IList;
+		}
+		
 		//////////////////////////
 
 		virtual public IDictionary Data {
Index: Filters/FilterApe.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterApe.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterApe.cs
--- Filters/FilterApe.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterApe.cs	8 Feb 2005 23:41:36 -0000
@@ -1,10 +1,7 @@
 //
 // FilterApe.cs : Register for reading of ape (Monkey audio) files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -29,7 +26,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Ape.Util;
 
 namespace Beagle.Filters {
 
@@ -44,6 +42,7 @@
 		
 		protected override void RegisterSupportedTypes ()
 		{
+			//FIXME: Does this really works ??
 			AddSupportedExtension (".ape");
 		}
 	}
Index: Filters/FilterFlac.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterFlac.cs,v
retrieving revision 1.2
diff -u -r1.2 FilterFlac.cs
--- Filters/FilterFlac.cs	10 Dec 2004 18:20:17 -0000	1.2
+++ Filters/FilterFlac.cs	8 Feb 2005 23:41:36 -0000
@@ -1,10 +1,7 @@
 //
 // FilterFlac.cs : Register for reading of flac files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 // Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,8 +25,8 @@
 
 using System;
 using System.IO;
-
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Flac.Util;
 
 namespace Beagle.Filters {
 
Index: Filters/FilterMp3.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterMp3.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterMp3.cs
--- Filters/FilterMp3.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterMp3.cs	8 Feb 2005 23:41:37 -0000
@@ -2,10 +2,7 @@
 // FilterMp3.cs : Register for reading of mp3 files, id3v2 is read, then missing
 //                 infos are filled with id3v1 values.
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -30,7 +27,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Mp3.Util;
 
 namespace Beagle.Filters {
 
@@ -42,10 +40,28 @@
 		
 		protected override Tag GetTag(Stream s)
 		{
-			Tag v2 = Id3v2Reader.Read ((FileStream)s);
-			Tag v1 = Id3v1Reader.Read ((FileStream)s);
+			//We will try to read both tags, then complete
+			//missing v2 fields from v1. if v2 does not
+			//exists, use v1, and vice versa.
+			
+			Tag v2 = null,v1 = null;
+			try {
+				v2 = Id3v2Reader.Read(s);
+			} catch(Exception e) {}
+			
+			try {
+				v1 = Id3v1Reader.Read(s);
+			} catch(Exception e) {}
+
+			if(v1 == null && v2 == null)
+				throw new Exception("There is no id3 (v1 or v2) tag in this file");
+			
+			if(v2 == null)
+				return v1;
+			
+			if(v1 != null)
+				v2.Merge( v1 );
 			
-			v2.Merge (v1);
 			return v2;
 		}
 		
Index: Filters/FilterMpc.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterMpc.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterMpc.cs
--- Filters/FilterMpc.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterMpc.cs	8 Feb 2005 23:41:37 -0000
@@ -1,10 +1,7 @@
 //
 // FilterMpc.cs : Register for reading of mpc (Musepack) files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -29,7 +26,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Ape.Util;
 
 namespace Beagle.Filters {
 
@@ -44,6 +42,7 @@
 		
 		protected override void RegisterSupportedTypes ()
 		{
+			//FIXME: Does this really works ??
 			AddSupportedExtension (".mpc");
 		}
 	}
Index: Filters/FilterMusic.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterMusic.cs,v
retrieving revision 1.9
diff -u -r1.9 FilterMusic.cs
--- Filters/FilterMusic.cs	22 Jan 2005 23:43:54 -0000	1.9
+++ Filters/FilterMusic.cs	8 Feb 2005 23:41:37 -0000
@@ -3,10 +3,7 @@
 //                  It will retreive the tag from the subclass, then fill the
 //                  beagle property as needed.
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -31,12 +28,15 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using System.Collections;
+
+using Entagged.Audioformats;
+using Entagged.Audioformats.Generic;
 
 namespace Beagle.Filters {
 
 	public abstract class FilterMusic : Beagle.Daemon.Filter {
-	
+		
 		private static Beagle.Util.Logger log = Beagle.Util.Logger.Get ("FilterMusic");
 		
 		public FilterMusic ()
@@ -54,43 +54,46 @@
 			try {
 				tag = GetTag (Stream);
 			} catch (Exception e) {
-				//FIXME: Is it better to throw an exception here ?
 				Finished();
 				return;
 			}
 			
 			log.Debug ("{0}", tag);
 			
-			//FIXME: Do we need to check for non-null empty values ?
-			//This should be done in Beagle.Property.New I think..
-			
-			if (tag.Artist.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:artist",  tag.Artist));
+			//If there are no values for a given field, it will simply be ignored.
+			AddBeagleProperty ("fixme:artist", tag.Artist);
 
-			if (tag.Album.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:album",   tag.Album));
+			AddBeagleProperty ("fixme:album",  tag.Album);
 			
-			if (tag.Title.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:title",    tag.Title));
+			AddBeagleProperty ("fixme:title",  tag.Title);
 
-			if (tag.Comment.Length > 0)
-				AddProperty (Beagle.Property.New ("fixme:comment", tag.Comment));
+			AddBeagleProperty ("fixme:comment",  tag.Comment);
 
-			if (tag.Track.Length > 0)
-				AddProperty (Beagle.Property.NewKeyword ("fixme:tracknumber", tag.Track));
+			AddBeagleProperty ("fixme:tracknumber",  tag.Track);
 
-			if (tag.Year.Length > 0)
-				AddProperty (Beagle.Property.NewKeyword ("fixme:year",  tag.Year));
+			AddBeagleProperty ("fixme:year",  tag.Year);
 
-			if (tag.Genre.Length > 0)
-				AddProperty (Beagle.Property.NewKeyword ("fixme:genre", tag.Genre));
+			AddBeagleProperty ("fixme:genre",  tag.Genre);
+			
 			
-			/* TBA
-			if (info.HasPicture)
--                               AddProperty (Beagle.Property.NewBool ("fixme:haspicture", true));
-			*/
+			//Adds miscellaneous metadata for that file
+			//could really be anything that is text, should be used only 
+			//for indexing purpose...
 			
+			AddBeaglePropertyMisc ("fixme:musicinfo", tag);
+						
 			Finished ();
 		}
+		
+		private void AddBeaglePropertyMisc(String id, Tag tag) {
+			foreach(TagField field in tag)
+				if(! field.IsCommon && field is TagTextField)
+					AddProperty (Beagle.Property.NewKeyword (id, (field as TagTextField).Content));
+		}
+		
+		private void AddBeagleProperty(String id,  IList fields) {
+			foreach(TagTextField field in fields)
+				AddProperty (Beagle.Property.NewKeyword (id, field.Content));
+		}
 	}
 }
Index: Filters/FilterOgg.cs
===================================================================
RCS file: /cvs/gnome/beagle/Filters/FilterOgg.cs,v
retrieving revision 1.1
diff -u -r1.1 FilterOgg.cs
--- Filters/FilterOgg.cs	10 Dec 2004 18:20:17 -0000	1.1
+++ Filters/FilterOgg.cs	8 Feb 2005 23:41:37 -0000
@@ -1,10 +1,7 @@
 //
 // FilterOgg.cs : Register for reading of ogg files
 //
-// Author:
-//		Raphaël Slinckx <raf.raf@wol.be>
-//
-// Copyright 2004 (C) Raphaël Slinckx
+// Copyright 2004 (C) Raphaël Slinckx <raphael@slinckx.net>
 //
 
 //
@@ -29,7 +26,8 @@
 
 using System;
 using System.IO;
-using Beagle.Util.AudioUtil;
+using Entagged.Audioformats;
+using Entagged.Audioformats.Ogg.Util;
 
 namespace Beagle.Filters {
 
Index: Tiles/Template.cs
===================================================================
RCS file: /cvs/gnome/beagle/Tiles/Template.cs,v
retrieving revision 1.7
diff -u -r1.7 Template.cs
--- Tiles/Template.cs	23 Jan 2005 01:22:38 -0000	1.7
+++ Tiles/Template.cs	8 Feb 2005 23:41:38 -0000
@@ -28,6 +28,8 @@
 using System;
 using System.Collections;
 using System.Reflection;
+using System.Text;
+
 using BU = Beagle.Util;
 
 namespace Beagle.Tile {
@@ -41,6 +43,8 @@
 
 		private Hashtable values = new Hashtable ();
 		
+		private TagBuilder tb = new TagBuilder(this);
+		
 		private void Setup (Stream stream)
 		{
 			StreamReader sr = new StreamReader (stream);
@@ -67,37 +71,30 @@
 			Setup (stream);
 		}
 
-		public void AddValues (IDictionary values)
-		{
-			foreach (string key in values.Keys)
-				this.values[key] = values[key];
-			dirty = true;
-		}
-
 		public void AddHit (Hit hit)
 		{
 			string uri = hit.Uri.ToString ();
 
-			values["Uri"] = uri;
+			this["Uri"] = uri;
 
 			if (uri.Length > 40)
 				uri = uri.Substring (0, 40) + "...";
-			values["DisplayUri"] = uri;
+			this["DisplayUri"] = uri;
 
-			values["MimeType"] = hit.MimeType;
-			values["Source"] = hit.Source;
-			values["Score"] = hit.Score.ToString ();
-			values["ScoreRaw"] = hit.ScoreRaw.ToString ();
-			values["ScoreMultiplier"] = hit.ScoreMultiplier.ToString ();
-			values["Revision"] = hit.Revision.ToString ();
-			values["Timestamp"] = BU.StringFu.DateTimeToString (hit.Timestamp);
-			values["Path"] = hit.Path;
-			values["FileName"] = hit.FileName;
-			values["DirectoryName"] = hit.DirectoryName;
+			this["MimeType"] = hit.MimeType;
+			this["Source"] = hit.Source;
+			this["Score"] = hit.Score.ToString ();
+			this["ScoreRaw"] = hit.ScoreRaw.ToString ();
+			this["ScoreMultiplier"] = hit.ScoreMultiplier.ToString ();
+			this["Revision"] = hit.Revision.ToString ();
+			this["Timestamp"] = BU.StringFu.DateTimeToString (hit.Timestamp);
+			this["Path"] = hit.Path;
+			this["FileName"] = hit.FileName;
+			this["DirectoryName"] = hit.DirectoryName;
 			if (hit.FileInfo != null) 
-				values["FolderName"] = hit.FileInfo.Directory.Name;
+				this["FolderName"] = hit.FileInfo.Directory.Name;
 			else if (hit.DirectoryInfo != null)
-				values["FolderName"] = hit.DirectoryInfo.Parent.Name;
+				this["FolderName"] = hit.DirectoryInfo.Parent.Name;
 			AddValues (hit.Properties);
 		}
 
@@ -106,38 +103,69 @@
 		}
 
 		public string this [string key] {
-			get { return (string) values[key]; }
+			get {
+				IList l = values [key] as IList;
+				if(l == null || l.Count == 0)
+					return null;
+
+				return l[0] as string;
+			}
 			set {
-				if (value == null) {
+				if (value == null || value == "") {
 					if (values.Contains (key)) 
 						values.Remove (key);
 					return;
 				}
-				values[key] = value as string;
+
+				IList l = new ArrayList ();
+				l.Add(value);
+				
+				values [key] = l;
 				dirty = true;
 			}
 		}
+		
+		public IList GetValues(string key) {
+			return values [key] as IList;
+		}
+		
+		public void AddValues (IDictionary values)
+		{
+			foreach (DictionaryEntry entry in values)
+				AddValues (entry.Key as string, entry.Value as string);
+			dirty = true;
+		}
+		
+		public void AddValues(string key, string val) {
+			IList l = values [key] as IList;
+			if(l == null) {
+				this [key] = val;
+				return;
+			}
+
+			l.Add(val);
+		}
 
 		private string GetValue (string key)
 		{
 			int pos;
 			string formatter;
 			string subkey;
-
+			
 			pos = key.IndexOf ('%');
 			
 			if (pos >= 0) {
 				formatter = key.Substring (0, pos);
 				subkey = key.Substring (pos + 1);
 			} else {
-				formatter = null;
+				formatter = "";
 				subkey = key;
 			}
 
 			switch (formatter) {
 			case "" :
 				if (values.Contains (subkey)) 
-					return (string)values[subkey];
+					return this [subkey];
 				else 
 					return null;
 			case "image" :
@@ -158,13 +186,13 @@
 								     size);
 			case "date" :
 				try {
-					return BU.StringFu.DateTimeToPrettyString (BU.StringFu.StringToDateTime ((string)values [subkey]));
+					return BU.StringFu.DateTimeToPrettyString (BU.StringFu.StringToDateTime (this [subkey]));
 				} catch {
-					return (string)values[subkey];
+					return this [subkey];
 				}
 			default :
 				if (values.Contains (key))
-					return BU.StringFu.EscapeStringForHtml ((string)values[subkey], false);
+					return BU.StringFu.EscapeStringForHtml (this [subkey], false);
 				else
 					return null;
 			}
@@ -174,32 +202,134 @@
 		{
 			StringWriter writer = new StringWriter ();
 			foreach (string line in lines) {
-				string new_line = "";
-				if (line.Length < 1) {
-					writer.WriteLine ("");
+				if (line.Trim().Length < 1) {
+					writer.WriteLine ();
 					continue;
 				}
 
+				if(line.Trim()[0] == '{') {
+					//Begins multiprop statement
+					//This kind of statement is of the form (on an empty line):
+					//
+					// { <ul> $ <li>@Title@</li> $ </ul> $ @Title@ }
+					//
+					// Fields are "$" separated inside it
+					// 1- Header
+					// 2- Repetitive part
+					// 3- Footer
+					// 4- Part if there is only one occurence of repetitive part
+					//
+					tb.DoIterative (writer, line);
+				}
+				else {
+					tb.Do (writer, line);
+				}
+			}
+
+			return writer.ToString ();
+		}
+		
+		private class TagBuilder {
+			private int index = 0;
+			private Template template;
+			
+			public TagBuilder(Template t) {
+				this.template = t;
+			}
+			
+			public void DoIterative (StringWriter writer, string line) {
+				string head, body, tail, alt;
+				bool ok = ParseIterative (line, out head, out body, out tail, out alt);
+				if( !ok )
+					return;
+				
+				
+				//Reset the index counter
+				index = 0;
+				
+				//Build the iterative part of the template
+				ArrayList body_lines = new ArrayList();
+				string s = ParseLine (body, true);
+				while(s != null) {
+					body_lines.Add(s);
+					s = ParseLine (body, true);
+				}
+				
+				
+				if(body_lines.Count <= 1) {
+					//We had a single match for the requested value
+					//We will use the alt part of the iterative construct
+					writer.WriteLine ( ParseLine (alt, false) );
+				}
+				else {
+					//We write the header, all the lines, and the tail
+					writer.WriteLine (head);					
+					
+					foreach(string body_line in body_lines)
+						writer.WriteLine (body_line);
+					
+					writer.WriteLine (tail);	
+				}
+			}
+			
+			public void Do (StringWriter writer, string line) {
+				writer.WriteLine ( ParseLine (line, false) );
+			}
+			
+			private bool ParseIterative (string line, out string head, out string body, out string tail, out string alt) {
+				line = line.Trim ();
+				line = line.Substring(0, line.Length -1).Substring(1);
+				
+				string[] args = line.Split ('$');
+				if(args.Length != 4) {
+					head = body = tail = alt = null;
+					return false;
+				}
+					
+				head = args[0].Trim();
+				body = args[1].Trim();
+				tail = args[2].Trim();
+				alt = args[3].Trim();
+				return true;
+			}
+			
+			private string ParseLine(string line, bool iterative) {
+				StringBuilder sb = new StringBuilder();
+				
 				string [] fragments = line.Split ('@');
 				for (int i = 0; i < fragments.Length;  i++) {
 					if (i % 2 == 1) {
-						string value = GetValue (fragments[i]);
-						if (value == null) {
-							new_line = "";
-							break;
+						string value = iterative ? EvaluateMultiTag (fragments[i]) :  EvaluateTag (fragments[i]);
+						
+						//If we have been asked for iterative, but got
+						//no result because index is at the end of the values
+						//we return null and the loop in DoIterative will terminate.
+						if(value == null && iterative)
+							return null;
+							
+						if (value != null) {
+							sb.Append(value);
 						}
-						new_line = new_line + value;
 					} else {
-						new_line = new_line + fragments[i];
+						sb.Append(fragments[i]);
 					}
 				}
-				if (new_line != "") 
-					writer.Write (new_line + "\n");
+				return sb.ToString ();
 			}
-
-			return writer.ToString ();
+			
+			private string EvaluateMultiTag (string key) {				
+				IList list = template.GetValues(key);
+				if(list == null || index >= list.Count)
+					return null;
+				
+				return list[index++] as string;
+			}
+			
+			private string EvaluateTag (string key) {
+				return template.GetValue(key);
+			}		
 		}
-
+		
 		public override string ToString ()
 		{
 			if (dirty) {
@@ -208,6 +338,6 @@
 			}
 
 			return string_html;
-		} 
+		}
 	}
 }        
Index: Util/Makefile.am
===================================================================
RCS file: /cvs/gnome/beagle/Util/Makefile.am,v
retrieving revision 1.42
diff -u -r1.42 Makefile.am
--- Util/Makefile.am	27 Jan 2005 20:24:06 -0000	1.42
+++ Util/Makefile.am	8 Feb 2005 23:41:38 -0000
@@ -10,7 +10,40 @@
 
 $(GOOGLE_CS): $(GOOGLE_WSDL)
 	wsdl -namespace:Beagle.Util -out:$@ $^
+	
+AUDIOFORMATS_CSFILES =   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagBinaryField.cs   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagField.cs   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagTextField.cs   \
+	$(srcdir)/entagged-sharp/ape/util/ApeTagReader.cs   \
+	$(srcdir)/entagged-sharp/ape/ApeTag.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v2TagSynchronizer.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v23TagReader.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/Id3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/TextId3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/CommId3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/id3frames/GenericId3Frame.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v1TagReader.cs   \
+	$(srcdir)/entagged-sharp/mp3/util/Id3v2TagReader.cs   \
+	$(srcdir)/entagged-sharp/mp3/Id3v1Tag.cs   \
+	$(srcdir)/entagged-sharp/mp3/Id3v2Tag.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/OggTagField.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/VorbisTagReader.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/OggPageHeader.cs   \
+	$(srcdir)/entagged-sharp/ogg/util/OggTagReader.cs   \
+	$(srcdir)/entagged-sharp/ogg/OggTag.cs   \
+	$(srcdir)/entagged-sharp/flac/util/FlacTagReader.cs   \
+	$(srcdir)/entagged-sharp/flac/util/MetadataBlockHeader.cs   \
+	$(srcdir)/entagged-sharp/Tag.cs   \
+	$(srcdir)/entagged-sharp/generic/TagTextField.cs   \
+	$(srcdir)/entagged-sharp/generic/AbstractTag.cs   \
+	$(srcdir)/entagged-sharp/generic/Utils.cs   \
+	$(srcdir)/entagged-sharp/generic/GenericTag.cs   \
+	$(srcdir)/entagged-sharp/generic/ByteBuffer.cs   \
+	$(srcdir)/entagged-sharp/generic/TagField.cs   \
+	$(srcdir)/entagged-sharp/exceptions/CannotReadException.cs
 
+	
 CSFILES = 			        	\
 	$(srcdir)/camel.cs              	\
 	$(srcdir)/FileAdvise.cs			\
@@ -44,13 +77,10 @@
 	$(srcdir)/Vfs.cs                        \
 	$(srcdir)/XKeybinder.cs
 
+
 if ! ENABLE_GST_SHARP
 CSFILES +=					\
-	$(srcdir)/ApeReader.cs			\
-	$(srcdir)/Mp3Reader.cs			\
-	$(srcdir)/FlacReader.cs			\
-	$(srcdir)/OggReader.cs			\
-	$(srcdir)/Tag.cs			
+	$(AUDIOFORMATS_CSFILES)
 endif
 
 ASSEMBLIES =					\
Index: beagled/LuceneDriver.cs
===================================================================
RCS file: /cvs/gnome/beagle/beagled/LuceneDriver.cs,v
retrieving revision 1.56
diff -u -r1.56 LuceneDriver.cs
--- beagled/LuceneDriver.cs	1 Feb 2005 22:07:40 -0000	1.56
+++ beagled/LuceneDriver.cs	8 Feb 2005 23:41:39 -0000
@@ -639,6 +639,11 @@
 			
 			// FIXME: We need to deal with duplicate properties in some
 			// sort of sane way.
+			
+			//Normally according to lucene docs:
+			// "Adds a field to a document. Several fields may be added with
+			// the same name. In this case, if the fields are indexed, their
+			// text is treated as though appended for the purposes of search."
 			foreach (Property prop in indexable.Properties) {
 				if (prop.Value != null) {
 					f = Field.Keyword (ToLucenePropertyKey (prop.Key),
@@ -831,7 +836,7 @@
 			foreach (Field ff in doc.Fields ()) {
 				string key = FromLucenePropertyKey (ff.Name ());
 				if (key != null)
-					hit [key] = ff.StringValue ();
+					hit.AddValueToProperty (key, ff.StringValue ());
 			}
 			
 			return hit;
