Index: lib/rb-marshal.list
===================================================================
diff -u -u -r1.15 rb-marshal.list
--- lib/rb-marshal.list	9 Apr 2006 11:02:15 -0000	1.15
+++ lib/rb-marshal.list	13 Apr 2006 06:24:23 -0000
@@ -1,5 +1,6 @@
 BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN
 BOOLEAN:POINTER
+BOOLEAN:STRING,ULONG,STRING,POINTER
 INT:VOID
 STRING:STRING
 VOID:BOOLEAN,BOOLEAN
diff -u -u -r1.2 rb-metadata-dbus-client.c
--- metadata/rb-metadata-dbus-client.c	27 Feb 2006 10:14:43 -0000	1.2
+++ metadata/rb-metadata-dbus-client.c	13 Apr 2006 06:24:24 -0000
@@ -69,6 +69,8 @@
 {
 	char *uri;
 	char *mimetype;
+	gboolean has_audio;
+	gboolean has_video;
 	GHashTable *metadata;
 };
 
@@ -385,6 +387,16 @@
 				     RB_METADATA_ERROR,
 				     RB_METADATA_ERROR_INTERNAL,
 				     _("D-BUS communication error"));
+		} else if (!rb_metadata_dbus_get_boolean (&iter, &md->priv->has_audio)) {
+			g_set_error (error,
+				     RB_METADATA_ERROR,
+				     RB_METADATA_ERROR_INTERNAL,
+				     _("D-BUS communication error"));
+		} else if (!rb_metadata_dbus_get_boolean (&iter, &md->priv->has_video)) {
+			g_set_error (error,
+				     RB_METADATA_ERROR,
+				     RB_METADATA_ERROR_INTERNAL,
+				     _("D-BUS communication error"));
 		} else {
 			/* get metadata */
 			rb_debug ("got mimetype: %s", md->priv->mimetype);
@@ -404,6 +416,18 @@
 }
 
 gboolean
+rb_metadata_has_audio (RBMetaData *md)
+{
+	return md->priv->has_audio;
+}
+
+gboolean
+rb_metadata_has_video (RBMetaData *md)
+{
+	return md->priv->has_video;
+}
+
+gboolean
 rb_metadata_get (RBMetaData *md, RBMetaDataField field,
 		 GValue *ret)
 {
@@ -529,4 +553,3 @@
 		read_error_from_message (md, &iter, error);
 	}
 }
-
diff -u -u -r1.5 rb-metadata-dbus-service.c
--- metadata/rb-metadata-dbus-service.c	8 Apr 2006 11:57:06 -0000	1.5
+++ metadata/rb-metadata-dbus-service.c	13 Apr 2006 06:24:24 -0000
@@ -98,6 +98,8 @@
 	GError *error = NULL;
 	gboolean ok = TRUE;
 	const char *mimetype = NULL;
+	gboolean has_audio;
+	gboolean has_video;
 
 	if (!dbus_message_iter_init (message, &iter)) {
 		return DBUS_HANDLER_RESULT_NEED_MEMORY;
@@ -132,10 +134,15 @@
 	}
 
 	mimetype = rb_metadata_get_mime (svc->metadata);
+	has_audio = rb_metadata_has_audio (svc->metadata);
+	has_video = rb_metadata_has_video (svc->metadata);
+	
 	dbus_message_iter_init_append (reply, &iter);
 
 	if (!dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &ok) ||
-	    !dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &mimetype)) {
+	    !dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &mimetype) ||
+	    !dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &has_audio) ||
+	    !dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &has_video)) {
 		rb_debug ("out of memory adding data to return message");
 		return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 	}
@@ -394,9 +401,7 @@
 	md = rb_metadata_new ();
 	rb_metadata_load (md, uri, &error);
 	if (error) {
-		if (error->code == RB_METADATA_ERROR_NOT_AUDIO_IGNORE) {
-			g_print ("%s is not an audio stream (ignored)\n", uri);
-		} else if (error->code == RB_METADATA_ERROR_NOT_AUDIO) {
+		if (error->code == RB_METADATA_ERROR_NOT_AUDIO) {
 			g_print ("%s is not an audio stream\n", uri);
 		} else {
 			g_print ("Error loading metadata from %s: %s\n", uri, error->message);
diff -u -u -r1.68 rb-metadata-gst.c
--- metadata/rb-metadata-gst.c	5 Apr 2006 21:48:49 -0000	1.68
+++ metadata/rb-metadata-gst.c	13 Apr 2006 06:24:25 -0000
@@ -50,16 +50,6 @@
 typedef GstElement *(*RBAddTaggerElem) (GstBin *, GstElement *);
 
 
-/*
- * The list of mine type prefixes for files that shouldn't display errors about being non-audio.
- * Useful for people who have cover art, et cetera, in their music directories
- */
-const char * ignore_mime_types[] = {
-	"image/",
-	"text/",
-	"application/xml"
-};
-
 struct RBMetadataGstType
 {
 	char *mimetype;
@@ -975,45 +965,24 @@
 			     RB_METADATA_ERROR_UNRECOGNIZED,
 			     _("The MIME type of the file could not be identified"));
 	} else if (md->priv->non_audio) {
-		gboolean ignore = FALSE;
-		int i;
+		const char *human_name;
 
-		if (md->priv->has_video) {
-			ignore = TRUE;
-		} else {
-			for (i = 0; i < G_N_ELEMENTS (ignore_mime_types); i++) {
-				if (g_str_has_prefix (md->priv->type, ignore_mime_types[i])) {
-					ignore = TRUE;
-					break;
-				}
-			}
-		}
+		human_name= rb_metadata_gst_type_to_name (md, md->priv->type);
+		if (human_name == NULL)
+			human_name = rb_mime_get_friendly_name (md->priv->type);
 
-
-		if (!ignore) {
-			const char *human_name;
-
-			human_name= rb_metadata_gst_type_to_name (md, md->priv->type);
-			if (human_name == NULL)
-				human_name = rb_mime_get_friendly_name (md->priv->type);
-			
-			if (human_name)
-				g_set_error (error,
-					     RB_METADATA_ERROR,
-					     RB_METADATA_ERROR_NOT_AUDIO,
-					     _("The GStreamer plugins to decode \"%s\" files cannot be found"),
-					     human_name);
-			else
-				g_set_error (error,
-					     RB_METADATA_ERROR,
-					     RB_METADATA_ERROR_NOT_AUDIO,
-					     _("The file contains a stream of type %s, which is not decodable"),
-					     md->priv->type);
-		} else
+		if (human_name)
+			g_set_error (error,
+				     RB_METADATA_ERROR,
+				     RB_METADATA_ERROR_NOT_AUDIO,
+				     _("The GStreamer plugins to decode \"%s\" files cannot be found"),
+				     human_name);
+		else
 			g_set_error (error,
 				     RB_METADATA_ERROR,
-				     RB_METADATA_ERROR_NOT_AUDIO_IGNORE,
-				     NULL);
+				     RB_METADATA_ERROR_NOT_AUDIO,
+				     _("The file contains a stream of type %s, which is not decodable"),
+				     md->priv->type);
 	} else if (!md->priv->handoff) {
 		const char *report_type = rb_metadata_gst_type_to_name (md, md->priv->type);
 		if (report_type == NULL)
@@ -1295,3 +1264,14 @@
 	return TRUE;
 }
 
+gboolean
+rb_metadata_has_video (RBMetaData *md)
+{
+	return md->priv->has_video;
+}
+
+gboolean
+rb_metadata_has_audio (RBMetaData *md)
+{
+	return !md->priv->non_audio;
+}
diff -u -u -r1.12 rb-metadata.h
--- metadata/rb-metadata.h	19 Feb 2006 11:30:08 -0000	1.12
+++ metadata/rb-metadata.h	13 Apr 2006 06:24:25 -0000
@@ -69,7 +69,6 @@
 	RB_METADATA_ERROR_GENERAL,
 	RB_METADATA_ERROR_INTERNAL,
 	RB_METADATA_ERROR_NOT_AUDIO,
-	RB_METADATA_ERROR_NOT_AUDIO_IGNORE,
 } RBMetaDataError;
 
 #define RB_METADATA_ERROR rb_metadata_error_quark ()
@@ -115,6 +114,8 @@
 					 GError **error);
 
 const char *	rb_metadata_get_mime	(RBMetaData *md);
+gboolean	rb_metadata_has_video	(RBMetaData *md);
+gboolean	rb_metadata_has_audio	(RBMetaData *md);
 
 gboolean	rb_metadata_get		(RBMetaData *md, RBMetaDataField field,
 					 GValue *val);
diff -u -u -r1.200 rhythmdb.c
--- rhythmdb/rhythmdb.c	12 Apr 2006 11:35:36 -0000	1.200
+++ rhythmdb/rhythmdb.c	13 Apr 2006 06:24:27 -0000
@@ -252,6 +252,7 @@
 	SAVE_COMPLETE,
 	SAVE_ERROR,
 	READ_ONLY,
+	IMPORT_ERROR,
 	LAST_SIGNAL
 };
 
@@ -351,7 +352,6 @@
 			      G_TYPE_STRING,
 			      G_TYPE_POINTER);
 
-
 	rhythmdb_signals[READ_ONLY] =
 		g_signal_new ("read-only",
 			      G_OBJECT_CLASS_TYPE (object_class),
@@ -362,6 +362,18 @@
 			      G_TYPE_NONE,
 			      1,
 			      G_TYPE_BOOLEAN);
+	
+	rhythmdb_signals[IMPORT_ERROR] =
+		g_signal_new ("import-error",
+			      G_OBJECT_CLASS_TYPE (object_class),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (RhythmDBClass, import_error),
+			      g_signal_accumulator_true_handled, NULL,
+			      rb_marshal_BOOLEAN__STRING_ULONG_STRING_POINTER,
+			      G_TYPE_BOOLEAN,
+			      4,
+			      G_TYPE_STRING, G_TYPE_ULONG,
+			      G_TYPE_STRING, G_TYPE_POINTER);
 
 	g_type_class_add_private (klass, sizeof (RhythmDBPrivate));
 }
@@ -1652,20 +1664,55 @@
 	char *msg;
 } RhythmDBLoadErrorData;
 
+/*
+ * The list of mine type prefixes for files that shouldn't display errors about being non-audio.
+ * Useful for people who have cover art, et cetera, in their music directories
+ */
+const char * ignore_mime_types[] = {
+	"image/",
+	"text/",
+	"application/xml",
+	"application/x-gzip",
+};
+
 static void
-rhythmdb_add_import_error_entry (RhythmDB *db, RhythmDBEvent *event)
-{
+rhythmdb_add_import_error_entry (RhythmDB *db, RhythmDBEvent *event) {
 	RhythmDBEntry *entry;
 	GValue value = {0,};
 	RhythmDBEntryType error_entry_type = RHYTHMDB_ENTRY_TYPE_IMPORT_ERROR;
+	const char *mimetype;
+	gboolean ignore = FALSE;
+	gboolean handled = FALSE;
+	int i;
+
+	mimetype = rb_metadata_get_mime (event->metadata);
+
+	/* allow plugins to affect error reporting */
+	g_signal_emit (db, rhythmdb_signals[IMPORT_ERROR], 0,
+		       event->real_uri, event->entry_type,
+		       mimetype, event->error,
+		       &handled);
+	if (handled)
+		return;
 
-	if (g_error_matches (event->error, RB_METADATA_ERROR, RB_METADATA_ERROR_NOT_AUDIO_IGNORE)) {
-		/* only add an ignore entry for the main library */
-		if (event->entry_type != RHYTHMDB_ENTRY_TYPE_SONG)
-			return;
+	
+	/* ignore files if they have known video, or are a blacklisted type */
+	if (event->entry_type != RHYTHMDB_ENTRY_TYPE_SONG) {
+		if (rb_metadata_has_video (event->metadata)) {
+			ignore = TRUE;
+		} else {
+		
+			for (i = 0; i < G_N_ELEMENTS (ignore_mime_types); i++) {
+				if (g_str_has_prefix (mimetype, ignore_mime_types[i])) {
+					ignore = TRUE;
+					break;
+				}
+			}
+		}
+	}
 
+	if (ignore)
 		error_entry_type = RHYTHMDB_ENTRY_TYPE_IGNORE;
-	}
 	
 	entry = rhythmdb_entry_lookup_by_location (db, event->real_uri);
 	if (entry) {
@@ -1741,13 +1788,14 @@
 		return FALSE;
 	}
 
+	mime = rb_metadata_get_mime (event->metadata);
+
 	if (event->error) {
 		rhythmdb_add_import_error_entry (db, event);
 		return TRUE;
 	}
 
 	/* do we really need to do this? */
-	mime = rb_metadata_get_mime (event->metadata);
 	if (!mime) {
 		rb_debug ("unsupported file");
 		return TRUE;
diff -u -u -r1.78 rhythmdb.h
--- rhythmdb/rhythmdb.h	9 Apr 2006 07:37:29 -0000	1.78
+++ rhythmdb/rhythmdb.h	13 Apr 2006 06:24:27 -0000
@@ -214,6 +214,9 @@
 	void	(*load_error)		(RhythmDB *db, const char *uri, const char *msg);
 	void	(*save_error)		(RhythmDB *db, const char *uri, const GError *error);
 	void	(*read_only)		(RhythmDB *db, gboolean readonly);
+	gboolean (*import_error)	(RhythmDB *db,
+					 const char *uri, RhythmDBEntryType entry_type,
+					 const char *mimetype, GError *error);
 
 	/* virtual methods */
 
