[grilo-plugins] all: Use the new source/plugins hierarchy



commit 0bfdabab8ac2cbb1bcf0e5791ed6611f27b9622a
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Tue May 3 16:49:02 2011 +0000

    all: Use the new source/plugins hierarchy
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/media/apple-trailers/grl-apple-trailers.c      |   34 +++---
 src/media/bliptv/grl-bliptv.c                      |   30 +++---
 src/media/bookmarks/grl-bookmarks.c                |   46 ++++----
 src/media/filesystem/grl-filesystem.c              |   49 +++++----
 src/media/flickr/grl-flickr.c                      |   38 +++---
 src/media/jamendo/grl-jamendo.c                    |   41 ++++---
 src/media/optical-media/grl-optical-media.c        |   30 +++---
 src/media/podcasts/grl-podcasts.c                  |   36 +++---
 src/media/shoutcast/grl-shoutcast.c                |   36 +++---
 src/media/tracker/grl-tracker-media-api.c          |  124 ++++++++++----------
 src/media/tracker/grl-tracker-media-api.h          |    8 +-
 src/media/tracker/grl-tracker-media-notif.c        |   10 +-
 src/media/tracker/grl-tracker-media-priv.h         |    2 +-
 src/media/tracker/grl-tracker-media.c              |   41 ++++---
 src/media/tracker/grl-tracker-metadata.c           |   16 ++-
 src/media/tracker/grl-tracker-utils.c              |    4 +-
 src/media/tracker/grl-tracker-utils.h              |    4 +-
 src/media/tracker/grl-tracker.c                    |   12 +-
 src/media/upnp/grl-upnp.c                          |   53 +++++----
 src/media/vimeo/grl-vimeo.c                        |   33 +++---
 src/media/youtube/grl-youtube.c                    |   48 ++++----
 src/metadata/fake-metadata/grl-fake-metadata.c     |   15 ++-
 src/metadata/gravatar/grl-gravatar.c               |   15 ++-
 src/metadata/lastfm-albumart/grl-lastfm-albumart.c |   23 ++--
 src/metadata/local-metadata/grl-local-metadata.c   |   28 +++--
 src/metadata/metadata-store/grl-metadata-store.c   |   23 ++--
 test/main.c                                        |   22 ++--
 27 files changed, 428 insertions(+), 393 deletions(-)
---
diff --git a/src/media/apple-trailers/grl-apple-trailers.c b/src/media/apple-trailers/grl-apple-trailers.c
index 2cd9908..801ba4f 100644
--- a/src/media/apple-trailers/grl-apple-trailers.c
+++ b/src/media/apple-trailers/grl-apple-trailers.c
@@ -83,25 +83,25 @@ static GrlAppleTrailersSource *grl_apple_trailers_source_new (gboolean hd,
                                                               gboolean xlarge);
 
 gboolean grl_apple_trailers_plugin_init (GrlPluginRegistry *registry,
-                                         const GrlPluginInfo *plugin,
+                                         GrlPlugin *plugin,
                                          GList *configs);
 
-static const GList *grl_apple_trailers_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_apple_trailers_source_supported_keys (GrlSource *source);
 
 static void grl_apple_trailers_source_browse (GrlMediaSource *source,
                                               GrlMediaSourceBrowseSpec *bs);
 
-static void grl_apple_trailers_source_cancel (GrlMetadataSource *source,
+static void grl_apple_trailers_source_cancel (GrlSource *source,
                                               guint operation_id);
 
-static GrlCaps *grl_apple_trailers_source_get_caps (GrlMetadataSource *source,
+static GrlCaps *grl_apple_trailers_source_get_caps (GrlSource *source,
                                                     GrlSupportedOps operation);
 
 /* =================== Apple Trailers Plugin  =============== */
 
 gboolean
 grl_apple_trailers_plugin_init (GrlPluginRegistry *registry,
-                                const GrlPluginInfo *plugin,
+                                GrlPlugin *plugin,
                                 GList *configs)
 {
   GrlAppleTrailersSource *source;
@@ -141,7 +141,7 @@ grl_apple_trailers_plugin_init (GrlPluginRegistry *registry,
   source = grl_apple_trailers_source_new (hd, xlarge);
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -215,16 +215,20 @@ grl_apple_trailers_source_set_property (GObject *object,
 static void
 grl_apple_trailers_source_class_init (GrlAppleTrailersSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   GObjectClass *g_class = G_OBJECT_CLASS (klass);
-  source_class->browse = grl_apple_trailers_source_browse;
-  metadata_class->cancel = grl_apple_trailers_source_cancel;
-  metadata_class->supported_keys = grl_apple_trailers_source_supported_keys;
-  metadata_class->get_caps = grl_apple_trailers_source_get_caps;
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
+
   g_class->finalize = grl_apple_trailers_source_finalize;
   g_class->set_property = grl_apple_trailers_source_set_property;
 
+  source_class->cancel = grl_apple_trailers_source_cancel;
+  source_class->supported_keys = grl_apple_trailers_source_supported_keys;
+  source_class->get_caps = grl_apple_trailers_source_get_caps;
+
+  media_class->browse = grl_apple_trailers_source_browse;
+
+
   g_object_class_install_property (g_class,
                                    PROP_HD,
                                    g_param_spec_boolean ("high-definition",
@@ -556,7 +560,7 @@ read_url_async (GrlAppleTrailersSource *source,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_apple_trailers_source_supported_keys (GrlMetadataSource *source)
+grl_apple_trailers_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -598,7 +602,7 @@ grl_apple_trailers_source_browse (GrlMediaSource *source,
 }
 
 static void
-grl_apple_trailers_source_cancel (GrlMetadataSource *source, guint operation_id)
+grl_apple_trailers_source_cancel (GrlSource *source, guint operation_id)
 {
   OperationData *op_data;
   GrlAppleTrailersSourcePriv *priv;
@@ -621,7 +625,7 @@ grl_apple_trailers_source_cancel (GrlMetadataSource *source, guint operation_id)
 }
 
 static GrlCaps *
-grl_apple_trailers_source_get_caps (GrlMetadataSource *source,
+grl_apple_trailers_source_get_caps (GrlSource *source,
                                     GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/bliptv/grl-bliptv.c b/src/media/bliptv/grl-bliptv.c
index 23d4f41..2068c19 100644
--- a/src/media/bliptv/grl-bliptv.c
+++ b/src/media/bliptv/grl-bliptv.c
@@ -88,12 +88,12 @@ static void bliptv_setup_mapping (void);
 static GrlBliptvSource *grl_bliptv_source_new (void);
 
 gboolean grl_bliptv_plugin_init (GrlPluginRegistry *registry,
-                                 const GrlPluginInfo *plugin,
+                                 GrlPlugin *plugin,
                                  GList *configs);
 
-static const GList *grl_bliptv_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_bliptv_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_bliptv_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_bliptv_source_get_caps (GrlSource *source,
                                              GrlSupportedOps operation);
 
 static void grl_bliptv_source_browse (GrlMediaSource *source,
@@ -102,14 +102,14 @@ static void grl_bliptv_source_browse (GrlMediaSource *source,
 static void grl_bliptv_source_search (GrlMediaSource *source,
                                       GrlMediaSourceSearchSpec *ss);
 
-static void grl_bliptv_source_cancel (GrlMediaSource *source,
+static void grl_bliptv_source_cancel (GrlSource *source,
                                       guint operation_id);
 
 /**/
 
 gboolean
 grl_bliptv_plugin_init (GrlPluginRegistry *registry,
-                        const GrlPluginInfo *plugin,
+                        GrlPlugin *plugin,
                         GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (bliptv_log_domain, "bliptv");
@@ -119,7 +119,7 @@ grl_bliptv_plugin_init (GrlPluginRegistry *registry,
   GrlBliptvSource *source = grl_bliptv_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -157,20 +157,20 @@ static void
 grl_bliptv_source_class_init (GrlBliptvSourceClass *klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
   g_type_class_add_private (klass, sizeof (GrlBliptvSourcePrivate));
 
   object_class->dispose = grl_bliptv_source_dispose;
   object_class->finalize = grl_bliptv_source_finalize;
 
-  source_class->browse = grl_bliptv_source_browse;
-  source_class->search = grl_bliptv_source_search;
+  source_class->supported_keys = grl_bliptv_source_supported_keys;
+  source_class->get_caps = grl_bliptv_source_get_caps;
   source_class->cancel = grl_bliptv_source_cancel;
 
-  metadata_class->supported_keys = grl_bliptv_source_supported_keys;
-  metadata_class->get_caps = grl_bliptv_source_get_caps;
+  media_class->browse = grl_bliptv_source_browse;
+  media_class->search = grl_bliptv_source_search;
 }
 
 static void
@@ -371,7 +371,7 @@ proxy_call_raw_async_cb (RestProxyCall *call,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_bliptv_source_supported_keys (GrlMetadataSource *source)
+grl_bliptv_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -479,7 +479,7 @@ grl_bliptv_source_search (GrlMediaSource *source,
 }
 
 static void
-grl_bliptv_source_cancel (GrlMediaSource *source, guint operation_id)
+grl_bliptv_source_cancel (GrlSource *source, guint operation_id)
 {
   BliptvOperation *op = grl_operation_get_data (operation_id);
 
@@ -503,7 +503,7 @@ grl_bliptv_source_cancel (GrlMediaSource *source, guint operation_id)
 }
 
 static GrlCaps *
-grl_bliptv_source_get_caps (GrlMetadataSource *source,
+grl_bliptv_source_get_caps (GrlSource *source,
                             GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/bookmarks/grl-bookmarks.c b/src/media/bookmarks/grl-bookmarks.c
index 8dc10e2..d2ee176 100644
--- a/src/media/bookmarks/grl-bookmarks.c
+++ b/src/media/bookmarks/grl-bookmarks.c
@@ -158,8 +158,8 @@ static GrlBookmarksSource *grl_bookmarks_source_new (void);
 
 static void grl_bookmarks_source_finalize (GObject *plugin);
 
-static const GList *grl_bookmarks_source_supported_keys (GrlMetadataSource *source);
-static GrlSupportedOps grl_bookmarks_source_supported_operations (GrlMetadataSource *metadata_source);
+static const GList *grl_bookmarks_source_supported_keys (GrlSource *source);
+static GrlSupportedOps grl_bookmarks_source_supported_operations (GrlSource *metadata_source);
 
 static void grl_bookmarks_source_search (GrlMediaSource *source,
 					 GrlMediaSourceSearchSpec *ss);
@@ -180,14 +180,14 @@ static gboolean grl_bookmarks_source_notify_change_start (GrlMediaSource *source
 static gboolean grl_bookmarks_source_notify_change_stop (GrlMediaSource *source,
                                                          GError **error);
 
-static GrlCaps * grl_bookmarks_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_bookmarks_source_get_caps (GrlSource *source,
                                                 GrlSupportedOps operation);
 
  /* =================== Bookmarks Plugin  =============== */
 
  static gboolean
  grl_bookmarks_plugin_init (GrlPluginRegistry *registry,
-                            const GrlPluginInfo *plugin,
+                            GrlPlugin *plugin,
                             GList *configs)
  {
    GParamSpec *spec;
@@ -217,7 +217,7 @@ static GrlCaps * grl_bookmarks_source_get_caps (GrlMetadataSource *source,
    GrlBookmarksSource *source = grl_bookmarks_source_new ();
    grl_plugin_registry_register_source (registry,
                                         plugin,
-                                        GRL_MEDIA_PLUGIN (source),
+                                        GRL_SOURCE (source),
                                         NULL);
    return TRUE;
  }
@@ -243,27 +243,25 @@ static GrlCaps * grl_bookmarks_source_get_caps (GrlMetadataSource *source,
  grl_bookmarks_source_class_init (GrlBookmarksSourceClass * klass)
  {
    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-   GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
+   GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+   GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
    gobject_class->finalize = grl_bookmarks_source_finalize;
 
-   metadata_class->supported_operations =
-     grl_bookmarks_source_supported_operations;
+   source_class->supported_operations = grl_bookmarks_source_supported_operations;
+   source_class->supported_keys = grl_bookmarks_source_supported_keys;
+   source_class->get_caps = grl_bookmarks_source_get_caps;
 
-   source_class->browse = grl_bookmarks_source_browse;
-   source_class->search = grl_bookmarks_source_search;
-   source_class->query = grl_bookmarks_source_query;
-   source_class->store = grl_bookmarks_source_store;
-   source_class->remove = grl_bookmarks_source_remove;
-   source_class->metadata = grl_bookmarks_source_metadata;
-   source_class->notify_change_start = grl_bookmarks_source_notify_change_start;
-   source_class->notify_change_stop = grl_bookmarks_source_notify_change_stop;
+   media_class->browse = grl_bookmarks_source_browse;
+   media_class->search = grl_bookmarks_source_search;
+   media_class->query = grl_bookmarks_source_query;
+   media_class->store = grl_bookmarks_source_store;
+   media_class->remove = grl_bookmarks_source_remove;
+   media_class->metadata = grl_bookmarks_source_metadata;
+   media_class->notify_change_start = grl_bookmarks_source_notify_change_start;
+   media_class->notify_change_stop = grl_bookmarks_source_notify_change_stop;
 
-  metadata_class->supported_keys = grl_bookmarks_source_supported_keys;
-  metadata_class->get_caps = grl_bookmarks_source_get_caps;
-
-  g_type_class_add_private (klass, sizeof (GrlBookmarksPrivate));
+   g_type_class_add_private (klass, sizeof (GrlBookmarksPrivate));
 }
 
 static void
@@ -722,7 +720,7 @@ store_bookmark (GrlBookmarksSource *bookmarks_source,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_bookmarks_source_supported_keys (GrlMetadataSource *source)
+grl_bookmarks_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -886,7 +884,7 @@ grl_bookmarks_source_metadata (GrlMediaSource *source,
 }
 
 static GrlSupportedOps
-grl_bookmarks_source_supported_operations (GrlMetadataSource *metadata_source)
+grl_bookmarks_source_supported_operations (GrlSource *metadata_source)
 {
   GrlSupportedOps caps;
 
@@ -919,7 +917,7 @@ grl_bookmarks_source_notify_change_stop (GrlMediaSource *source,
 }
 
 static GrlCaps *
-grl_bookmarks_source_get_caps (GrlMetadataSource *source,
+grl_bookmarks_source_get_caps (GrlSource *source,
                                GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/filesystem/grl-filesystem.c b/src/media/filesystem/grl-filesystem.c
index 1f137a8..eaa4201 100644
--- a/src/media/filesystem/grl-filesystem.c
+++ b/src/media/filesystem/grl-filesystem.c
@@ -120,12 +120,12 @@ static GrlFilesystemSource *grl_filesystem_source_new (void);
 static void grl_filesystem_source_finalize (GObject *object);
 
 gboolean grl_filesystem_plugin_init (GrlPluginRegistry *registry,
-                                     const GrlPluginInfo *plugin,
+                                     GrlPlugin *plugin,
                                      GList *configs);
 
-static const GList *grl_filesystem_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_filesystem_source_supported_keys (GrlSource *source);
 
-static GrlCaps *grl_filesystem_source_get_caps (GrlMetadataSource *source,
+static GrlCaps *grl_filesystem_source_get_caps (GrlSource *source,
                                                 GrlSupportedOps operation);
 
 static void grl_filesystem_source_metadata (GrlMediaSource *source,
@@ -144,7 +144,7 @@ static gboolean grl_filesystem_test_media_from_uri (GrlMediaSource *source,
 static void grl_filesystem_get_media_from_uri (GrlMediaSource *source,
                                                GrlMediaSourceMediaFromUriSpec *mfus);
 
-static void grl_filesystem_source_cancel (GrlMetadataSource *source,
+static void grl_filesystem_source_cancel (GrlSource *source,
                                           guint operation_id);
 
 static gboolean grl_filesystem_source_notify_change_start (GrlMediaSource *source,
@@ -157,7 +157,7 @@ static gboolean grl_filesystem_source_notify_change_stop (GrlMediaSource *source
 
 gboolean
 grl_filesystem_plugin_init (GrlPluginRegistry *registry,
-                            const GrlPluginInfo *plugin,
+                            GrlPlugin *plugin,
                             GList *configs)
 {
   GrlConfig *config;
@@ -186,7 +186,7 @@ grl_filesystem_plugin_init (GrlPluginRegistry *registry,
 
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 
   return TRUE;
@@ -217,19 +217,24 @@ grl_filesystem_source_new (void)
 static void
 grl_filesystem_source_class_init (GrlFilesystemSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
-  source_class->browse = grl_filesystem_source_browse;
-  source_class->search = grl_filesystem_source_search;
-  source_class->notify_change_start = grl_filesystem_source_notify_change_start;
-  source_class->notify_change_stop = grl_filesystem_source_notify_change_stop;
-  source_class->metadata = grl_filesystem_source_metadata;
-  source_class->test_media_from_uri = grl_filesystem_test_media_from_uri;
-  source_class->media_from_uri = grl_filesystem_get_media_from_uri;
-  G_OBJECT_CLASS (source_class)->finalize = grl_filesystem_source_finalize;
-  metadata_class->supported_keys = grl_filesystem_source_supported_keys;
-  metadata_class->cancel = grl_filesystem_source_cancel;
-  metadata_class->get_caps = grl_filesystem_source_get_caps;
+  GObjectClass *g_class = G_OBJECT_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
+
+  g_class->finalize = grl_filesystem_source_finalize;
+
+  source_class->supported_keys = grl_filesystem_source_supported_keys;
+  source_class->cancel = grl_filesystem_source_cancel;
+  source_class->get_caps = grl_filesystem_source_get_caps;
+
+  media_class->browse = grl_filesystem_source_browse;
+  media_class->search = grl_filesystem_source_search;
+  media_class->notify_change_start = grl_filesystem_source_notify_change_start;
+  media_class->notify_change_stop = grl_filesystem_source_notify_change_stop;
+  media_class->metadata = grl_filesystem_source_metadata;
+  media_class->test_media_from_uri = grl_filesystem_test_media_from_uri;
+  media_class->media_from_uri = grl_filesystem_get_media_from_uri;
+
   g_type_class_add_private (klass, sizeof (GrlFilesystemSourcePrivate));
 }
 
@@ -1211,7 +1216,7 @@ directory_cb (GFileInfo *dir_info, RecursiveOperation *operation)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_filesystem_source_supported_keys (GrlMetadataSource *source)
+grl_filesystem_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1397,7 +1402,7 @@ beach:
 }
 
 static void
-grl_filesystem_source_cancel (GrlMetadataSource *source, guint operation_id)
+grl_filesystem_source_cancel (GrlSource *source, guint operation_id)
 {
   GCancellable *cancellable;
   GrlFilesystemSourcePrivate *priv;
@@ -1455,7 +1460,7 @@ grl_filesystem_source_notify_change_stop (GrlMediaSource *source,
 }
 
 static GrlCaps *
-grl_filesystem_source_get_caps (GrlMetadataSource *source,
+grl_filesystem_source_get_caps (GrlSource *source,
                                 GrlSupportedOps operation)
 {
   GList *keys;
diff --git a/src/media/flickr/grl-flickr.c b/src/media/flickr/grl-flickr.c
index 873c5a6..c7a200d 100644
--- a/src/media/flickr/grl-flickr.c
+++ b/src/media/flickr/grl-flickr.c
@@ -85,7 +85,7 @@ static void token_info_cb (GFlickr *f,
 static GrlFlickrSource *grl_flickr_source_public_new (const gchar *flickr_api_key,
                                                       const gchar *flickr_secret);
 
-static void grl_flickr_source_personal_new (const GrlPluginInfo *plugin,
+static void grl_flickr_source_personal_new (GrlPlugin *plugin,
                                             const gchar *flickr_api_key,
                                             const gchar *flickr_secret,
                                             const gchar *flickr_token);
@@ -93,13 +93,13 @@ static void grl_flickr_source_personal_new (const GrlPluginInfo *plugin,
 static void grl_flickr_source_finalize (GObject *object);
 
 gboolean grl_flickr_plugin_init (GrlPluginRegistry *registry,
-				 const GrlPluginInfo *plugin,
+                                 GrlPlugin *plugin,
                                  GList *configs);
 
 
-static const GList *grl_flickr_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_flickr_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_flickr_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_flickr_source_get_caps (GrlSource *source,
                                              GrlSupportedOps operation);
 
 static void grl_flickr_source_browse (GrlMediaSource *source,
@@ -115,7 +115,7 @@ static void grl_flickr_source_search (GrlMediaSource *source,
 
 gboolean
 grl_flickr_plugin_init (GrlPluginRegistry *registry,
-                        const GrlPluginInfo *plugin,
+                        GrlPlugin *plugin,
                         GList *configs)
 {
   gchar *flickr_key;
@@ -155,7 +155,7 @@ grl_flickr_plugin_init (GrlPluginRegistry *registry,
       public_source_created = TRUE;
       grl_plugin_registry_register_source (registry,
                                            plugin,
-                                           GRL_MEDIA_PLUGIN (source),
+                                           GRL_SOURCE (source),
                                            NULL);
     }
 
@@ -199,7 +199,7 @@ grl_flickr_source_public_new (const gchar *flickr_api_key,
 }
 
 static void
-grl_flickr_source_personal_new (const GrlPluginInfo *plugin,
+grl_flickr_source_personal_new (GrlPlugin *plugin,
                                 const gchar *flickr_api_key,
                                 const gchar *flickr_secret,
                                 const gchar *flickr_token)
@@ -214,15 +214,17 @@ static void
 grl_flickr_source_class_init (GrlFlickrSourceClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
   gobject_class->finalize = grl_flickr_source_finalize;
-  source_class->browse = grl_flickr_source_browse;
-  source_class->metadata = grl_flickr_source_metadata;
-  source_class->search = grl_flickr_source_search;
-  metadata_class->supported_keys = grl_flickr_source_supported_keys;
-  metadata_class->get_caps = grl_flickr_source_get_caps;
+
+  source_class->supported_keys = grl_flickr_source_supported_keys;
+  source_class->get_caps = grl_flickr_source_get_caps;
+
+  media_class->browse = grl_flickr_source_browse;
+  media_class->metadata = grl_flickr_source_metadata;
+  media_class->search = grl_flickr_source_search;
 
   g_type_class_add_private (klass, sizeof (GrlFlickrSourcePrivate));
 }
@@ -258,7 +260,7 @@ token_info_cb (GFlickr *f,
                gpointer user_data)
 {
   GrlFlickrSource *source;
-  GrlPluginInfo *plugin = (GrlPluginInfo *) user_data;
+  GrlPlugin *plugin = (GrlPlugin *) user_data;
   GrlPluginRegistry *registry;
   gchar *fullname;
   gchar *source_desc;
@@ -296,7 +298,7 @@ token_info_cb (GFlickr *f,
     source->priv->user_id = g_strdup (g_hash_table_lookup (info, "user_nsid"));
     grl_plugin_registry_register_source (registry,
                                          plugin,
-                                         GRL_MEDIA_PLUGIN (source),
+                                         GRL_SOURCE (source),
                                          NULL);
   }
 
@@ -592,7 +594,7 @@ gettags_cb (GFlickr *f, GList *taglist, gpointer user_data)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_flickr_source_supported_keys (GrlMetadataSource *source)
+grl_flickr_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -770,7 +772,7 @@ grl_flickr_source_search (GrlMediaSource *source,
 }
 
 static GrlCaps *
-grl_flickr_source_get_caps (GrlMetadataSource *source,
+grl_flickr_source_get_caps (GrlSource *source,
                             GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/jamendo/grl-jamendo.c b/src/media/jamendo/grl-jamendo.c
index fa80106..77b7f19 100644
--- a/src/media/jamendo/grl-jamendo.c
+++ b/src/media/jamendo/grl-jamendo.c
@@ -172,13 +172,13 @@ struct _GrlJamendoSourcePriv {
 static GrlJamendoSource *grl_jamendo_source_new (void);
 
 gboolean grl_jamendo_plugin_init (GrlPluginRegistry *registry,
-                                  const GrlPluginInfo *plugin,
+                                  GrlPlugin *plugin,
                                   GList *configs);
 
-static const GList *grl_jamendo_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_jamendo_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_jamendo_source_get_caps (GrlMetadataSource *source,
-                                              GrlSupportedOps operation);
+static GrlCaps *grl_jamendo_source_get_caps (GrlSource *source,
+                                             GrlSupportedOps operation);
 
 static void grl_jamendo_source_metadata (GrlMediaSource *source,
                                          GrlMediaSourceMetadataSpec *ms);
@@ -192,14 +192,14 @@ static void grl_jamendo_source_query (GrlMediaSource *source,
 static void grl_jamendo_source_search (GrlMediaSource *source,
                                        GrlMediaSourceSearchSpec *ss);
 
-static void grl_jamendo_source_cancel (GrlMetadataSource *source,
+static void grl_jamendo_source_cancel (GrlSource *source,
                                        guint operation_id);
 
 /* =================== Jamendo Plugin  =============== */
 
 gboolean
 grl_jamendo_plugin_init (GrlPluginRegistry *registry,
-                         const GrlPluginInfo *plugin,
+                         GrlPlugin *plugin,
                          GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (jamendo_log_domain, "jamendo");
@@ -209,7 +209,7 @@ grl_jamendo_plugin_init (GrlPluginRegistry *registry,
   GrlJamendoSource *source = grl_jamendo_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -252,18 +252,21 @@ grl_jamendo_source_finalize (GObject *object)
 static void
 grl_jamendo_source_class_init (GrlJamendoSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   GObjectClass *g_class = G_OBJECT_CLASS (klass);
-  source_class->metadata = grl_jamendo_source_metadata;
-  source_class->browse = grl_jamendo_source_browse;
-  source_class->query = grl_jamendo_source_query;
-  source_class->search = grl_jamendo_source_search;
-  metadata_class->cancel = grl_jamendo_source_cancel;
-  metadata_class->supported_keys = grl_jamendo_source_supported_keys;
-  metadata_class->get_caps = grl_jamendo_source_get_caps;
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
+
   g_class->finalize = grl_jamendo_source_finalize;
 
+  source_class->cancel = grl_jamendo_source_cancel;
+  source_class->supported_keys = grl_jamendo_source_supported_keys;
+  source_class->get_caps = grl_jamendo_source_get_caps;
+
+  media_class->metadata = grl_jamendo_source_metadata;
+  media_class->browse = grl_jamendo_source_browse;
+  media_class->query = grl_jamendo_source_query;
+  media_class->search = grl_jamendo_source_search;
+
   g_type_class_add_private (klass, sizeof (GrlJamendoSourcePriv));
 }
 
@@ -947,7 +950,7 @@ parse_query (const gchar *query, JamendoCategory *category, gchar **term)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_jamendo_source_supported_keys (GrlMetadataSource *source)
+grl_jamendo_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1362,7 +1365,7 @@ grl_jamendo_source_search (GrlMediaSource *source,
 }
 
 static void
-grl_jamendo_source_cancel (GrlMetadataSource *source, guint operation_id)
+grl_jamendo_source_cancel (GrlSource *source, guint operation_id)
 {
   XmlParseEntries *xpe;
   GrlJamendoSourcePriv *priv;
@@ -1388,7 +1391,7 @@ grl_jamendo_source_cancel (GrlMetadataSource *source, guint operation_id)
 }
 
 static GrlCaps *
-grl_jamendo_source_get_caps (GrlMetadataSource *source,
+grl_jamendo_source_get_caps (GrlSource *source,
                              GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/optical-media/grl-optical-media.c b/src/media/optical-media/grl-optical-media.c
index 27fc522..88d3c96 100644
--- a/src/media/optical-media/grl-optical-media.c
+++ b/src/media/optical-media/grl-optical-media.c
@@ -66,18 +66,18 @@ static GrlOpticalMediaSource *grl_optical_media_source_new (void);
 static void grl_optical_media_source_finalize (GObject *object);
 
 gboolean grl_optical_media_plugin_init (GrlPluginRegistry *registry,
-                                        const GrlPluginInfo *plugin,
+                                        GrlPlugin *plugin,
                                         GList *configs);
 
-static const GList *grl_optical_media_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_optical_media_source_supported_keys (GrlSource *source);
 
-static GrlCaps *grl_optical_media_source_get_caps (GrlMetadataSource *source,
+static GrlCaps *grl_optical_media_source_get_caps (GrlSource *source,
                                                    GrlSupportedOps operation);
 
 static void grl_optical_media_source_browse (GrlMediaSource *source,
                                              GrlMediaSourceBrowseSpec *bs);
 
-static void grl_optical_media_source_cancel (GrlMetadataSource *source,
+static void grl_optical_media_source_cancel (GrlSource *source,
                                              guint operation_id);
 
 static void
@@ -89,7 +89,7 @@ on_g_volume_monitor_event (GVolumeMonitor *monitor,
 
 gboolean
 grl_optical_media_plugin_init (GrlPluginRegistry *registry,
-                               const GrlPluginInfo *plugin,
+                               GrlPlugin *plugin,
                                GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (optical_media_log_domain, "optical_media");
@@ -100,7 +100,7 @@ grl_optical_media_plugin_init (GrlPluginRegistry *registry,
 
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 
   return TRUE;
@@ -132,17 +132,17 @@ grl_optical_media_source_new (void)
 static void
 grl_optical_media_source_class_init (GrlOpticalMediaSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
   object_class->finalize = grl_optical_media_source_finalize;
 
-  source_class->browse = grl_optical_media_source_browse;
+  source_class->supported_keys = grl_optical_media_source_supported_keys;
+  source_class->cancel = grl_optical_media_source_cancel;
+  source_class->get_caps = grl_optical_media_source_get_caps;
 
-  metadata_class->supported_keys = grl_optical_media_source_supported_keys;
-  metadata_class->cancel = grl_optical_media_source_cancel;
-  metadata_class->get_caps = grl_optical_media_source_get_caps;
+  media_class->browse = grl_optical_media_source_browse;
 
   g_type_class_add_private (klass, sizeof (GrlOpticalMediaSourcePrivate));
 }
@@ -199,7 +199,7 @@ on_g_volume_monitor_event (GVolumeMonitor *monitor,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_optical_media_source_supported_keys (GrlMetadataSource *source)
+grl_optical_media_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -543,7 +543,7 @@ grl_optical_media_source_browse (GrlMediaSource *source,
 }
 
 static void
-grl_optical_media_source_cancel (GrlMetadataSource *source, guint operation_id)
+grl_optical_media_source_cancel (GrlSource *source, guint operation_id)
 {
   GCancellable *cancellable;
 
@@ -555,7 +555,7 @@ grl_optical_media_source_cancel (GrlMetadataSource *source, guint operation_id)
 }
 
 static GrlCaps *
-grl_optical_media_source_get_caps (GrlMetadataSource *source,
+grl_optical_media_source_get_caps (GrlSource *source,
                                    GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/podcasts/grl-podcasts.c b/src/media/podcasts/grl-podcasts.c
index b4953a9..62a3132 100644
--- a/src/media/podcasts/grl-podcasts.c
+++ b/src/media/podcasts/grl-podcasts.c
@@ -235,9 +235,9 @@ static GrlPodcastsSource *grl_podcasts_source_new (void);
 
 static void grl_podcasts_source_finalize (GObject *plugin);
 
-static const GList *grl_podcasts_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_podcasts_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_podcasts_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_podcasts_source_get_caps (GrlSource *source,
                                                GrlSupportedOps operation);
 
 static void grl_podcasts_source_browse (GrlMediaSource *source,
@@ -261,7 +261,7 @@ static gboolean grl_podcasts_source_notify_change_stop (GrlMediaSource *source,
 
 static gboolean
 grl_podcasts_plugin_init (GrlPluginRegistry *registry,
-                          const GrlPluginInfo *plugin,
+                          GrlPlugin *plugin,
                           GList *configs)
 {
   GrlConfig *config;
@@ -275,7 +275,7 @@ grl_podcasts_plugin_init (GrlPluginRegistry *registry,
   GrlPodcastsSource *source = grl_podcasts_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 
   source->priv->cache_time = DEFAULT_CACHE_TIME;
@@ -325,22 +325,22 @@ static void
 grl_podcasts_source_class_init (GrlPodcastsSourceClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
   gobject_class->finalize = grl_podcasts_source_finalize;
 
-  source_class->browse = grl_podcasts_source_browse;
-  source_class->search = grl_podcasts_source_search;
-  source_class->query = grl_podcasts_source_query;
-  source_class->metadata = grl_podcasts_source_metadata;
-  source_class->store = grl_podcasts_source_store;
-  source_class->remove = grl_podcasts_source_remove;
-  source_class->notify_change_start = grl_podcasts_source_notify_change_start;
-  source_class->notify_change_stop = grl_podcasts_source_notify_change_stop;
+  source_class->supported_keys = grl_podcasts_source_supported_keys;
+  source_class->get_caps = grl_podcasts_source_get_caps;
 
-  metadata_class->supported_keys = grl_podcasts_source_supported_keys;
-  metadata_class->get_caps = grl_podcasts_source_get_caps;
+  media_class->browse = grl_podcasts_source_browse;
+  media_class->search = grl_podcasts_source_search;
+  media_class->query = grl_podcasts_source_query;
+  media_class->metadata = grl_podcasts_source_metadata;
+  media_class->store = grl_podcasts_source_store;
+  media_class->remove = grl_podcasts_source_remove;
+  media_class->notify_change_start = grl_podcasts_source_notify_change_start;
+  media_class->notify_change_stop = grl_podcasts_source_notify_change_stop;
 
   g_type_class_add_private (klass, sizeof (GrlPodcastsPrivate));
 }
@@ -1596,7 +1596,7 @@ media_id_is_podcast (const gchar *id)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_podcasts_source_supported_keys (GrlMetadataSource *source)
+grl_podcasts_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1814,7 +1814,7 @@ grl_podcasts_source_notify_change_stop (GrlMediaSource *source,
 }
 
 static GrlCaps *
-grl_podcasts_source_get_caps (GrlMetadataSource *source,
+grl_podcasts_source_get_caps (GrlSource *source,
                               GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/shoutcast/grl-shoutcast.c b/src/media/shoutcast/grl-shoutcast.c
index d16c208..719daf0 100644
--- a/src/media/shoutcast/grl-shoutcast.c
+++ b/src/media/shoutcast/grl-shoutcast.c
@@ -95,12 +95,12 @@ typedef struct {
 static GrlShoutcastSource *grl_shoutcast_source_new (const gchar *dev_key);
 
 gboolean grl_shoutcast_plugin_init (GrlPluginRegistry *registry,
-                                    const GrlPluginInfo *plugin,
+                                    GrlPlugin *plugin,
                                     GList *configs);
 
-static const GList *grl_shoutcast_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_shoutcast_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_shoutcast_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_shoutcast_source_get_caps (GrlSource *source,
                                                 GrlSupportedOps operation);
 
 static void grl_shoutcast_source_metadata (GrlMediaSource *source,
@@ -112,7 +112,7 @@ static void grl_shoutcast_source_browse (GrlMediaSource *source,
 static void grl_shoutcast_source_search (GrlMediaSource *source,
                                          GrlMediaSourceSearchSpec *ss);
 
-static void grl_shoutcast_source_cancel (GrlMetadataSource *source,
+static void grl_shoutcast_source_cancel (GrlSource *source,
                                          guint operation_id);
 
 static void read_url_async (GrlShoutcastSource *source,
@@ -125,7 +125,7 @@ static void grl_shoutcast_source_finalize (GObject *object);
 
 gboolean
 grl_shoutcast_plugin_init (GrlPluginRegistry *registry,
-                           const GrlPluginInfo *plugin,
+                           GrlPlugin *plugin,
                            GList *configs)
 {
   gchar *dev_key;
@@ -157,7 +157,7 @@ grl_shoutcast_plugin_init (GrlPluginRegistry *registry,
   source = grl_shoutcast_source_new (dev_key);
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 
   g_free (dev_key);
@@ -192,19 +192,19 @@ grl_shoutcast_source_new (const gchar *dev_key)
 static void
 grl_shoutcast_source_class_init (GrlShoutcastSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
-  source_class->metadata = grl_shoutcast_source_metadata;
-  source_class->browse = grl_shoutcast_source_browse;
-  source_class->search = grl_shoutcast_source_search;
+  gobject_class->finalize = grl_shoutcast_source_finalize;
 
-  metadata_class->cancel = grl_shoutcast_source_cancel;
-  metadata_class->supported_keys = grl_shoutcast_source_supported_keys;
-  metadata_class->get_caps = grl_shoutcast_source_get_caps;
+  source_class->cancel = grl_shoutcast_source_cancel;
+  source_class->supported_keys = grl_shoutcast_source_supported_keys;
+  source_class->get_caps = grl_shoutcast_source_get_caps;
 
-  gobject_class->finalize = grl_shoutcast_source_finalize;
+  media_class->metadata = grl_shoutcast_source_metadata;
+  media_class->browse = grl_shoutcast_source_browse;
+  media_class->search = grl_shoutcast_source_search;
 
   g_type_class_add_private (klass, sizeof (GrlShoutcastSourcePriv));
 }
@@ -618,7 +618,7 @@ read_url_async (GrlShoutcastSource *source,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_shoutcast_source_supported_keys (GrlMetadataSource *source)
+grl_shoutcast_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -790,7 +790,7 @@ grl_shoutcast_source_search (GrlMediaSource *source,
 }
 
 static void
-grl_shoutcast_source_cancel (GrlMetadataSource *source, guint operation_id)
+grl_shoutcast_source_cancel (GrlSource *source, guint operation_id)
 {
   OperationData *op_data;
   GrlShoutcastSourcePriv *priv;
@@ -812,7 +812,7 @@ grl_shoutcast_source_cancel (GrlMetadataSource *source, guint operation_id)
 }
 
 static GrlCaps *
-grl_shoutcast_source_get_caps (GrlMetadataSource *source,
+grl_shoutcast_source_get_caps (GrlSource *source,
                                GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/tracker/grl-tracker-media-api.c b/src/media/tracker/grl-tracker-media-api.c
index 8211903..494cf50 100644
--- a/src/media/tracker/grl-tracker-media-api.c
+++ b/src/media/tracker/grl-tracker-media-api.c
@@ -426,44 +426,44 @@ tracker_metadata_cb (GObject      *source_object,
   grl_tracker_queue_done (grl_tracker_queue, os);
 }
 
-static void
-tracker_set_metadata_cb (GObject      *source_object,
-                         GAsyncResult *result,
-                         GrlTrackerOp *os)
-{
-  GrlMetadataSourceSetMetadataSpec *sms =
-    (GrlMetadataSourceSetMetadataSpec *) os->data;
-  GrlTrackerMediaPriv *priv = GRL_TRACKER_MEDIA_GET_PRIVATE (sms->source);
-  GError *tracker_error = NULL, *error = NULL;
-
-  tracker_sparql_connection_update_finish (priv->tracker_connection,
-                                           result,
-                                           &tracker_error);
-
-  if (tracker_error) {
-    GRL_WARNING ("Could not execute sparql update : %s",
-                 tracker_error->message);
-
-    error = g_error_new (GRL_CORE_ERROR,
-			 GRL_CORE_ERROR_SET_METADATA_FAILED,
-			 "Failed to set metadata : %s",
-                         tracker_error->message);
-
-    sms->callback (sms->source, sms->media, NULL, sms->user_data, error);
-
-    g_error_free (tracker_error);
-    g_error_free (error);
-  } else {
-    sms->callback (sms->source, sms->media, NULL, sms->user_data, error);
-  }
-
-  grl_tracker_queue_done (grl_tracker_queue, os);
-}
+/* static void */
+/* tracker_set_metadata_cb (GObject      *source_object, */
+/*                          GAsyncResult *result, */
+/*                          GrlTrackerOp *os) */
+/* { */
+/*   GrlMetadataSourceSetMetadataSpec *sms = */
+/*     (GrlMetadataSourceSetMetadataSpec *) os->data; */
+/*   GrlTrackerMediaPriv *priv = GRL_TRACKER_MEDIA_GET_PRIVATE (sms->source); */
+/*   GError *tracker_error = NULL, *error = NULL; */
+
+/*   tracker_sparql_connection_update_finish (priv->tracker_connection, */
+/*                                            result, */
+/*                                            &tracker_error); */
+
+/*   if (tracker_error) { */
+/*     GRL_WARNING ("Could not execute sparql update : %s", */
+/*                  tracker_error->message); */
+
+/*     error = g_error_new (GRL_CORE_ERROR, */
+/* 			 GRL_CORE_ERROR_SET_METADATA_FAILED, */
+/* 			 "Failed to set metadata : %s", */
+/*                          tracker_error->message); */
+
+/*     sms->callback (sms->source, sms->media, NULL, sms->user_data, error); */
+
+/*     g_error_free (tracker_error); */
+/*     g_error_free (error); */
+/*   } else { */
+/*     sms->callback (sms->source, sms->media, NULL, sms->user_data, error); */
+/*   } */
+
+/*   grl_tracker_queue_done (grl_tracker_queue, os); */
+/* } */
 
 /**/
 
 const GList *
-grl_tracker_media_writable_keys (GrlMetadataSource *source)
+grl_tracker_media_writable_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -651,39 +651,39 @@ grl_tracker_media_metadata (GrlMediaSource *source,
     g_free (sparql_select);
 }
 
-void
-grl_tracker_media_set_metadata (GrlMetadataSource *source,
-                                GrlMetadataSourceSetMetadataSpec *sms)
-{
-  /* GrlTrackerMediaPriv *priv = GRL_TRACKER_MEDIA_GET_PRIVATE (source); */
-  gchar *sparql_delete, *sparql_cdelete, *sparql_insert, *sparql_final;
-  const gchar *urn = grl_data_get_string (GRL_DATA (sms->media),
-                                          grl_metadata_key_tracker_urn);
-  GrlTrackerOp *os;
+/* void */
+/* grl_tracker_media_set_metadata (GrlMetadataSource *source, */
+/*                                 GrlMetadataSourceSetMetadataSpec *sms) */
+/* { */
+/*   /\* GrlTrackerMediaPriv *priv = GRL_TRACKER_MEDIA_GET_PRIVATE (source); *\/ */
+/*   gchar *sparql_delete, *sparql_cdelete, *sparql_insert, *sparql_final; */
+/*   const gchar *urn = grl_data_get_string (GRL_DATA (sms->media), */
+/*                                           grl_metadata_key_tracker_urn); */
+/*   GrlTrackerOp *os; */
 
-  GRL_IDEBUG ("%s: urn=%s", G_STRFUNC, urn);
+/*   GRL_IDEBUG ("%s: urn=%s", G_STRFUNC, urn); */
 
-  sparql_delete = grl_tracker_get_delete_string (sms->keys);
-  sparql_cdelete = grl_tracker_get_delete_conditional_string (urn, sms->keys);
-  sparql_insert = grl_tracker_tracker_get_insert_string (sms->media, sms->keys);
-  sparql_final = g_strdup_printf (TRACKER_SAVE_REQUEST,
-                                  urn, sparql_delete,
-                                  urn, sparql_cdelete,
-                                  urn, sparql_insert);
+/*   sparql_delete = grl_tracker_get_delete_string (sms->keys); */
+/*   sparql_cdelete = grl_tracker_get_delete_conditional_string (urn, sms->keys); */
+/*   sparql_insert = grl_tracker_tracker_get_insert_string (sms->media, sms->keys); */
+/*   sparql_final = g_strdup_printf (TRACKER_SAVE_REQUEST, */
+/*                                   urn, sparql_delete, */
+/*                                   urn, sparql_cdelete, */
+/*                                   urn, sparql_insert); */
 
-  os = grl_tracker_op_initiate_set_metadata (sparql_final,
-                                             (GAsyncReadyCallback) tracker_set_metadata_cb,
-                                             sms);
-  os->keys = sms->keys;
+/*   os = grl_tracker_op_initiate_set_metadata (sparql_final, */
+/*                                              (GAsyncReadyCallback) tracker_set_metadata_cb, */
+/*                                              sms); */
+/*   os->keys = sms->keys; */
 
-  GRL_IDEBUG ("\trequest: '%s'", sparql_final);
+/*   GRL_IDEBUG ("\trequest: '%s'", sparql_final); */
 
-  grl_tracker_queue_push (grl_tracker_queue, os);
+/*   grl_tracker_queue_push (grl_tracker_queue, os); */
 
-  g_free (sparql_delete);
-  g_free (sparql_cdelete);
-  g_free (sparql_insert);
-}
+/*   g_free (sparql_delete); */
+/*   g_free (sparql_cdelete); */
+/*   g_free (sparql_insert); */
+/* } */
 
 void
 grl_tracker_media_search (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss)
@@ -865,7 +865,7 @@ grl_tracker_media_browse (GrlMediaSource *source,
 }
 
 void
-grl_tracker_media_cancel (GrlMetadataSource *source, guint operation_id)
+grl_tracker_media_cancel (GrlSource *source, guint operation_id)
 {
   GrlTrackerOp *os;
 
diff --git a/src/media/tracker/grl-tracker-media-api.h b/src/media/tracker/grl-tracker-media-api.h
index 604bfbb..f745a67 100644
--- a/src/media/tracker/grl-tracker-media-api.h
+++ b/src/media/tracker/grl-tracker-media-api.h
@@ -32,7 +32,7 @@
 
 void grl_tracker_media_init_requests (void);
 
-const GList *grl_tracker_media_writable_keys (GrlMetadataSource *source);
+const GList *grl_tracker_media_writable_keys (GrlSource *source);
 
 void grl_tracker_media_query (GrlMediaSource *source,
                               GrlMediaSourceQuerySpec *qs);
@@ -40,10 +40,10 @@ void grl_tracker_media_query (GrlMediaSource *source,
 void grl_tracker_media_metadata (GrlMediaSource *source,
                                  GrlMediaSourceMetadataSpec *ms);
 
-void grl_tracker_media_set_metadata (GrlMetadataSource *source,
-                                     GrlMetadataSourceSetMetadataSpec *sms);
+/* void grl_tracker_media_set_metadata (GrlMetadataSource *source, */
+/*                                      GrlMetadataSourceSetMetadataSpec *sms); */
 
-void grl_tracker_media_cancel (GrlMetadataSource *source, guint operation_id);
+void grl_tracker_media_cancel (GrlSource *source, guint operation_id);
 
 void grl_tracker_media_search (GrlMediaSource *source,
                                GrlMediaSourceSearchSpec *ss);
diff --git a/src/media/tracker/grl-tracker-media-notif.c b/src/media/tracker/grl-tracker-media-notif.c
index 5f42746..935eb55 100644
--- a/src/media/tracker/grl-tracker-media-notif.c
+++ b/src/media/tracker/grl-tracker-media-notif.c
@@ -146,7 +146,7 @@ tracker_evt_update_media_del (tracker_evt_update_t *evt,
   evt->old_sources = g_list_append (evt->old_sources, source);
 
   GRL_DEBUG ("Predel source p=%p name=%s id=%s count=%u", source,
-             grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)),
+             grl_source_get_name (GRL_SOURCE (source)),
              grl_tracker_media_get_tracker_source (source),
              priv->notification_ref);
 }
@@ -234,7 +234,7 @@ tracker_evt_update_orphan_item_cb (GObject              *object,
         g_free (str_id);
 
         GRL_DEBUG ("\tNotify id=%u source=%s p=%p", id,
-                   grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)),
+                   grl_source_get_name (GRL_SOURCE (source)),
                    source);
         grl_media_source_notify_change (GRL_MEDIA_SOURCE (source),
                                         media, change_type, FALSE);
@@ -313,7 +313,7 @@ tracker_evt_update_orphans (tracker_evt_update_t *evt)
       while (source != NULL) {
         if (GRL_IS_TRACKER_MEDIA (source->data)) {
           GRL_DEBUG ("\tNotify id=%u source=%s p=%p", id,
-                     grl_metadata_source_get_name (GRL_METADATA_SOURCE (source->data)),
+                     grl_source_get_name (GRL_SOURCE (source->data)),
                      source->data);
           if (grl_tracker_media_can_notify (GRL_TRACKER_MEDIA (source->data))) {
             GrlMedia *media = grl_media_new ();
@@ -375,7 +375,7 @@ tracker_evt_update_items_cb (gpointer              key,
 
   if (!grl_tracker_media_can_notify (source)) {
     GRL_DEBUG ("\tno notification for source %s...",
-	       grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)));
+	       grl_source_get_name (GRL_SOURCE (source)));
     return;
   }
 
@@ -385,7 +385,7 @@ tracker_evt_update_items_cb (gpointer              key,
   g_free (str_id);
 
   GRL_DEBUG ("\tNotify id=%u source=%s", id,
-             grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)));
+             grl_source_get_name (GRL_SOURCE (source)));
   grl_media_source_notify_change (GRL_MEDIA_SOURCE (source), media,
                                   evt->change_type, FALSE);
 
diff --git a/src/media/tracker/grl-tracker-media-priv.h b/src/media/tracker/grl-tracker-media-priv.h
index 3836c99..aa8c46a 100644
--- a/src/media/tracker/grl-tracker-media-priv.h
+++ b/src/media/tracker/grl-tracker-media-priv.h
@@ -71,7 +71,7 @@ struct _GrlTrackerMediaPriv {
 
 /**/
 
-extern const GrlPluginInfo *grl_tracker_plugin;
+extern GrlPlugin *grl_tracker_plugin;
 
 /* shared data across  */
 extern GrlTrackerCache *grl_tracker_item_cache;
diff --git a/src/media/tracker/grl-tracker-media.c b/src/media/tracker/grl-tracker-media.c
index 4c21ce7..236393a 100644
--- a/src/media/tracker/grl-tracker-media.c
+++ b/src/media/tracker/grl-tracker-media.c
@@ -93,25 +93,26 @@ grl_tracker_media_new (TrackerSparqlConnection *connection)
 static void
 grl_tracker_media_class_init (GrlTrackerMediaClass * klass)
 {
-  GrlMediaSourceClass    *source_class   = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
-  GObjectClass           *g_class        = G_OBJECT_CLASS (klass);
-
-  source_class->query               = grl_tracker_media_query;
-  source_class->metadata            = grl_tracker_media_metadata;
-  source_class->search              = grl_tracker_media_search;
-  source_class->browse              = grl_tracker_media_browse;
-  source_class->notify_change_start = grl_tracker_media_change_start;
-  source_class->notify_change_stop  = grl_tracker_media_change_stop;
-
-  metadata_class->cancel         = grl_tracker_media_cancel;
-  metadata_class->supported_keys = grl_tracker_supported_keys;
-  metadata_class->writable_keys  = grl_tracker_media_writable_keys;
-  metadata_class->set_metadata   = grl_tracker_media_set_metadata;
+  GObjectClass        *g_class      = G_OBJECT_CLASS (klass);
+  GrlSourceClass      *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class  = GRL_MEDIA_SOURCE_CLASS (klass);
 
   g_class->finalize     = grl_tracker_media_finalize;
   g_class->set_property = grl_tracker_media_set_property;
 
+  source_class->cancel         = grl_tracker_media_cancel;
+  source_class->supported_keys = grl_tracker_supported_keys;
+  source_class->writable_keys  = grl_tracker_media_writable_keys;
+  /* source_class->set_metadata   = grl_tracker_media_set_metadata; */
+
+  media_class->query               = grl_tracker_media_query;
+  media_class->metadata            = grl_tracker_media_metadata;
+  media_class->search              = grl_tracker_media_search;
+  media_class->browse              = grl_tracker_media_browse;
+  media_class->notify_change_start = grl_tracker_media_change_start;
+  media_class->notify_change_stop  = grl_tracker_media_change_stop;
+
+
   g_object_class_install_property (g_class,
                                    PROP_TRACKER_CONNECTION,
                                    g_param_spec_object ("tracker-connection",
@@ -216,7 +217,7 @@ grl_tracker_add_source (GrlTrackerMedia *source)
   GrlTrackerMediaPriv *priv = GRL_TRACKER_MEDIA_GET_PRIVATE (source);
 
   GRL_DEBUG ("====================>add source '%s' count=%u",
-             grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)),
+             grl_source_get_name (GRL_SOURCE (source)),
              priv->notification_ref);
 
   if (priv->notification_ref > 0) {
@@ -231,7 +232,7 @@ grl_tracker_add_source (GrlTrackerMedia *source)
     priv->state = GRL_TRACKER_MEDIA_STATE_RUNNING;
     grl_plugin_registry_register_source (grl_plugin_registry_get_default (),
                                          grl_tracker_plugin,
-                                         GRL_MEDIA_PLUGIN (source),
+                                         GRL_SOURCE (source),
                                          NULL);
   }
 }
@@ -242,7 +243,7 @@ grl_tracker_del_source (GrlTrackerMedia *source)
   GrlTrackerMediaPriv *priv = GRL_TRACKER_MEDIA_GET_PRIVATE (source);
 
   GRL_DEBUG ("==================>del source '%s' count=%u",
-             grl_metadata_source_get_name (GRL_METADATA_SOURCE (source)),
+             grl_source_get_name (GRL_SOURCE (source)),
              priv->notification_ref);
   if (priv->notification_ref > 0) {
     priv->notification_ref--;
@@ -255,7 +256,7 @@ grl_tracker_del_source (GrlTrackerMedia *source)
     grl_tracker_media_cache_del_source (grl_tracker_item_cache, source);
     priv->state = GRL_TRACKER_MEDIA_STATE_DELETED;
     grl_plugin_registry_unregister_source (grl_plugin_registry_get_default (),
-                                           GRL_MEDIA_PLUGIN (source),
+                                           GRL_SOURCE (source),
                                            NULL);
   }
 }
@@ -291,7 +292,7 @@ match_plugin_id (gpointer key,
                  gpointer value,
                  gpointer user_data)
 {
-  if (g_strcmp0 (grl_metadata_source_get_id (GRL_METADATA_SOURCE (value)),
+  if (g_strcmp0 (grl_source_get_id (GRL_SOURCE (value)),
                  (gchar *) user_data) == 0) {
     return TRUE;
   }
diff --git a/src/media/tracker/grl-tracker-metadata.c b/src/media/tracker/grl-tracker-metadata.c
index d0ca06b..e001be8 100644
--- a/src/media/tracker/grl-tracker-metadata.c
+++ b/src/media/tracker/grl-tracker-metadata.c
@@ -116,17 +116,19 @@ grl_tracker_metadata_new (TrackerSparqlConnection *connection)
 static void
 grl_tracker_metadata_class_init (GrlTrackerMetadataClass * klass)
 {
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   GObjectClass           *g_class        = G_OBJECT_CLASS (klass);
-
-  metadata_class->supported_keys = grl_tracker_supported_keys;
-  metadata_class->may_resolve    = grl_tracker_metadata_may_resolve;
-  metadata_class->resolve        = grl_tracker_metadata_resolve;
-  metadata_class->get_caps       = grl_tracker_get_caps;
+  GrlSourceClass         *source_class   = GRL_SOURCE_CLASS (klass);
+  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
 
   g_class->finalize     = grl_tracker_metadata_finalize;
   g_class->set_property = grl_tracker_metadata_set_property;
 
+  source_class->supported_keys = grl_tracker_supported_keys;
+  source_class->get_caps       = grl_tracker_get_caps;
+
+  metadata_class->may_resolve = grl_tracker_metadata_may_resolve;
+  metadata_class->resolve     = grl_tracker_metadata_resolve;
+
   g_object_class_install_property (g_class,
                                    PROP_TRACKER_CONNECTION,
                                    g_param_spec_object ("tracker-connection",
@@ -362,7 +364,7 @@ grl_tracker_metadata_source_init (void)
 
   grl_plugin_registry_register_source (grl_plugin_registry_get_default (),
                                        grl_tracker_plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 }
 
diff --git a/src/media/tracker/grl-tracker-utils.c b/src/media/tracker/grl-tracker-utils.c
index 676e014..76bf021 100644
--- a/src/media/tracker/grl-tracker-utils.c
+++ b/src/media/tracker/grl-tracker-utils.c
@@ -657,7 +657,7 @@ grl_tracker_get_media_name (const gchar *rdf_type,
 }
 
 const GList *
-grl_tracker_supported_keys (GrlMetadataSource *source)
+grl_tracker_supported_keys (GrlSource *source)
 {
   static GList *supported_keys = NULL;
 
@@ -669,7 +669,7 @@ grl_tracker_supported_keys (GrlMetadataSource *source)
 }
 
 GrlCaps *
-grl_tracker_get_caps (GrlMetadataSource *source,
+grl_tracker_get_caps (GrlSource *source,
                       GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/tracker/grl-tracker-utils.h b/src/media/tracker/grl-tracker-utils.h
index 60e8ee2..14862ca 100644
--- a/src/media/tracker/grl-tracker-utils.h
+++ b/src/media/tracker/grl-tracker-utils.h
@@ -62,9 +62,9 @@ typedef struct {
 
 extern GrlKeyID grl_metadata_key_tracker_urn;
 
-const GList *grl_tracker_supported_keys (GrlMetadataSource *source);
+const GList *grl_tracker_supported_keys (GrlSource *source);
 
-GrlCaps * grl_tracker_get_caps (GrlMetadataSource *source,
+GrlCaps * grl_tracker_get_caps (GrlSource *source,
                                 GrlSupportedOps operation);
 
 gboolean grl_tracker_key_is_supported (const GrlKeyID key);
diff --git a/src/media/tracker/grl-tracker.c b/src/media/tracker/grl-tracker.c
index eb9653f..69d8621 100644
--- a/src/media/tracker/grl-tracker.c
+++ b/src/media/tracker/grl-tracker.c
@@ -69,13 +69,13 @@ GRL_LOG_DOMAIN_STATIC(tracker_general_log_domain);
 /* --- Other --- */
 
 gboolean grl_tracker_plugin_init (GrlPluginRegistry *registry,
-                                  const GrlPluginInfo *plugin,
+                                  GrlPlugin *plugin,
                                   GList *configs);
 
 /* ===================== Globals  ================= */
 
 TrackerSparqlConnection *grl_tracker_connection = NULL;
-const GrlPluginInfo *grl_tracker_plugin;
+GrlPlugin *grl_tracker_plugin;
 gboolean grl_tracker_upnp_present = FALSE;
 GrlTrackerQueue *grl_tracker_queue = NULL;
 
@@ -184,9 +184,9 @@ tracker_get_upnp_class_cb (GObject      *object,
 }
 
 static void
-tracker_get_connection_cb (GObject             *object,
-                           GAsyncResult        *res,
-                           const GrlPluginInfo *plugin)
+tracker_get_connection_cb (GObject      *object,
+                           GAsyncResult *res,
+                           GrlPlugin    *plugin)
 {
   GError *error = NULL;
   /* GrlTrackerMedia *source; */
@@ -212,7 +212,7 @@ tracker_get_connection_cb (GObject             *object,
 
 gboolean
 grl_tracker_plugin_init (GrlPluginRegistry *registry,
-                         const GrlPluginInfo *plugin,
+                         GrlPlugin *plugin,
                          GList *configs)
 {
   GrlConfig *config;
diff --git a/src/media/upnp/grl-upnp.c b/src/media/upnp/grl-upnp.c
index 4572ec7..aca89f4 100644
--- a/src/media/upnp/grl-upnp.c
+++ b/src/media/upnp/grl-upnp.c
@@ -89,7 +89,7 @@ struct SourceInfo {
   gchar *source_name;
   GUPnPDeviceProxy* device;
   GUPnPServiceProxy* service;
-  GrlPluginInfo *plugin;
+  GrlPlugin *plugin;
 };
 
 static void setup_key_mappings (void);
@@ -99,14 +99,14 @@ static gchar *build_source_id (const gchar *udn);
 static GrlUpnpSource *grl_upnp_source_new (const gchar *id, const gchar *name);
 
 gboolean grl_upnp_plugin_init (GrlPluginRegistry *registry,
-                               const GrlPluginInfo *plugin,
+                               GrlPlugin *plugin,
                                GList *configs);
 
 static void grl_upnp_source_finalize (GObject *plugin);
 
-static const GList *grl_upnp_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_upnp_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_upnp_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_upnp_source_get_caps (GrlSource *source,
                                            GrlSupportedOps operation);
 
 static void grl_upnp_source_browse (GrlMediaSource *source,
@@ -121,7 +121,7 @@ static void grl_upnp_source_query (GrlMediaSource *source,
 static void grl_upnp_source_metadata (GrlMediaSource *source,
                                       GrlMediaSourceMetadataSpec *ms);
 
-static GrlSupportedOps grl_upnp_source_supported_operations (GrlMetadataSource *source);
+static GrlSupportedOps grl_upnp_source_supported_operations (GrlSource *source);
 
 static gboolean grl_upnp_source_notify_change_start (GrlMediaSource *source,
                                                      GError **error);
@@ -149,7 +149,7 @@ static GUPnPContextManager *context_manager = NULL;
 
 gboolean
 grl_upnp_plugin_init (GrlPluginRegistry *registry,
-                      const GrlPluginInfo *plugin,
+                      GrlPlugin *plugin,
                       GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (upnp_log_domain, "upnp");
@@ -173,7 +173,7 @@ grl_upnp_plugin_init (GrlPluginRegistry *registry,
 }
 
 static void
-grl_upnp_plugin_deinit (void)
+grl_upnp_plugin_deinit (GrlPlugin *plugin)
 {
   GRL_DEBUG ("grl_upnp_plugin_deinit");
 
@@ -217,21 +217,21 @@ static void
 grl_upnp_source_class_init (GrlUpnpSourceClass * klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
   gobject_class->finalize = grl_upnp_source_finalize;
 
-  metadata_class->supported_keys = grl_upnp_source_supported_keys;
-  metadata_class->supported_operations = grl_upnp_source_supported_operations;
-  metadata_class->get_caps = grl_upnp_source_get_caps;
+  source_class->supported_keys = grl_upnp_source_supported_keys;
+  source_class->supported_operations = grl_upnp_source_supported_operations;
+  source_class->get_caps = grl_upnp_source_get_caps;
 
-  source_class->browse = grl_upnp_source_browse;
-  source_class->search = grl_upnp_source_search;
-  source_class->query = grl_upnp_source_query;
-  source_class->metadata = grl_upnp_source_metadata;
-  source_class->notify_change_start = grl_upnp_source_notify_change_start;
-  source_class->notify_change_stop = grl_upnp_source_notify_change_stop;
+  media_class->browse = grl_upnp_source_browse;
+  media_class->search = grl_upnp_source_search;
+  media_class->query = grl_upnp_source_query;
+  media_class->metadata = grl_upnp_source_metadata;
+  media_class->notify_change_start = grl_upnp_source_notify_change_start;
+  media_class->notify_change_stop = grl_upnp_source_notify_change_stop;
 
   g_type_class_add_private (klass, sizeof (GrlUpnpPrivate));
 
@@ -275,6 +275,7 @@ free_source_info (struct SourceInfo *info)
   g_free (info->source_name);
   g_object_unref (info->device);
   g_object_unref (info->service);
+  g_object_unref (info->plugin);
   g_slice_free (struct SourceInfo, info);
 }
 
@@ -361,7 +362,7 @@ gupnp_search_caps_cb (GUPnPServiceProxy *service,
 
   grl_plugin_registry_register_source (registry,
                                        source_info->plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 
  free_resources:
@@ -441,7 +442,7 @@ device_available_cb (GUPnPControlPoint *cp,
   source_info->source_name = name;
   source_info->device = g_object_ref (device);
   source_info->service = g_object_ref (service);
-  source_info->plugin = (GrlPluginInfo *) user_data;
+  source_info->plugin = g_object_ref ((GrlPlugin *) user_data);
 
   if (!gupnp_service_proxy_begin_action (GUPNP_SERVICE_PROXY (service),
 					 "GetSearchCapabilities",
@@ -454,7 +455,7 @@ device_available_cb (GUPnPControlPoint *cp,
     registry = grl_plugin_registry_get_default ();
     grl_plugin_registry_register_source (registry,
                                          source_info->plugin,
-                                         GRL_MEDIA_PLUGIN (source),
+                                         GRL_SOURCE (source),
                                          NULL);
     free_source_info (source_info);
   }
@@ -470,7 +471,7 @@ device_unavailable_cb (GUPnPControlPoint *cp,
 		       gpointer user_data)
 {
   const gchar* udn;
-  GrlMediaPlugin *source;
+  GrlSource *source;
   GrlPluginRegistry *registry;
   gchar *source_id;
 
@@ -1060,7 +1061,7 @@ gupnp_metadata_cb (GUPnPServiceProxy *service,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_upnp_source_supported_keys (GrlMetadataSource *source)
+grl_upnp_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1307,7 +1308,7 @@ grl_upnp_source_metadata (GrlMediaSource *source,
 }
 
 static GrlSupportedOps
-grl_upnp_source_supported_operations (GrlMetadataSource *metadata_source)
+grl_upnp_source_supported_operations (GrlSource *metadata_source)
 {
   GrlSupportedOps caps;
   GrlUpnpSource *source;
@@ -1339,7 +1340,7 @@ grl_upnp_source_notify_change_start (GrlMediaSource *source,
                  GRL_CORE_ERROR,
                  GRL_CORE_ERROR_NOTIFY_CHANGED_FAILED,
                  "Unable to listen for changes in %s",
-                 grl_metadata_source_get_id (GRL_METADATA_SOURCE (source)));
+                 grl_source_get_id (GRL_SOURCE (source)));
     return FALSE;
   }
   gupnp_service_proxy_set_subscribed (upnp_source->priv->service, TRUE);
@@ -1364,7 +1365,7 @@ grl_upnp_source_notify_change_stop (GrlMediaSource *source,
 }
 
 static GrlCaps *
-grl_upnp_source_get_caps (GrlMetadataSource *source,
+grl_upnp_source_get_caps (GrlSource *source,
                           GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/media/vimeo/grl-vimeo.c b/src/media/vimeo/grl-vimeo.c
index 9c69ffd..a2fc81c 100644
--- a/src/media/vimeo/grl-vimeo.c
+++ b/src/media/vimeo/grl-vimeo.c
@@ -67,12 +67,12 @@ struct _GrlVimeoSourcePrivate {
 static GrlVimeoSource *grl_vimeo_source_new (void);
 
 gboolean grl_vimeo_plugin_init (GrlPluginRegistry *registry,
-				const GrlPluginInfo *plugin,
-				GList *configs);
+                                GrlPlugin *plugin,
+                                GList *configs);
 
-static const GList *grl_vimeo_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_vimeo_source_supported_keys (GrlSource *source);
 
-static GrlCaps * grl_vimeo_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_vimeo_source_get_caps (GrlSource *source,
                                             GrlSupportedOps operation);
 
 static void grl_vimeo_source_metadata (GrlMediaSource *source,
@@ -85,8 +85,8 @@ static void grl_vimeo_source_search (GrlMediaSource *source,
 
 gboolean
 grl_vimeo_plugin_init (GrlPluginRegistry *registry,
-                        const GrlPluginInfo *plugin,
-                        GList *configs)
+                       GrlPlugin *plugin,
+                       GList *configs)
 {
   gchar *vimeo_key;
   gchar *vimeo_secret;
@@ -131,7 +131,7 @@ grl_vimeo_plugin_init (GrlPluginRegistry *registry,
 
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   init_result = TRUE;
 
@@ -166,13 +166,14 @@ grl_vimeo_source_new (void)
 static void
 grl_vimeo_source_class_init (GrlVimeoSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
 
-  source_class->metadata = grl_vimeo_source_metadata;
-  source_class->search = grl_vimeo_source_search;
-  metadata_class->supported_keys = grl_vimeo_source_supported_keys;
-  metadata_class->get_caps = grl_vimeo_source_get_caps;
+  source_class->supported_keys = grl_vimeo_source_supported_keys;
+  source_class->get_caps = grl_vimeo_source_get_caps;
+
+  media_class->metadata = grl_vimeo_source_metadata;
+  media_class->search = grl_vimeo_source_search;
 
   g_type_class_add_private (klass, sizeof (GrlVimeoSourcePrivate));
 }
@@ -357,7 +358,7 @@ video_get_play_url_cb (gchar *url, gpointer user_data)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_vimeo_source_supported_keys (GrlMetadataSource *source)
+grl_vimeo_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -437,8 +438,8 @@ grl_vimeo_source_search (GrlMediaSource *source,
 }
 
 static GrlCaps *
-grl_vimeo_source_get_caps (GrlMetadataSource *source,
-                            GrlSupportedOps operation)
+grl_vimeo_source_get_caps (GrlSource *source,
+                           GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
 
diff --git a/src/media/youtube/grl-youtube.c b/src/media/youtube/grl-youtube.c
index 7068d69..51be00b 100644
--- a/src/media/youtube/grl-youtube.c
+++ b/src/media/youtube/grl-youtube.c
@@ -186,14 +186,14 @@ static void grl_youtube_source_set_property (GObject *object,
 static void grl_youtube_source_finalize (GObject *object);
 
 gboolean grl_youtube_plugin_init (GrlPluginRegistry *registry,
-                                  const GrlPluginInfo *plugin,
+                                  GrlPlugin *plugin,
                                   GList *configs);
 
-static const GList *grl_youtube_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_youtube_source_supported_keys (GrlSource *source);
 
-static const GList *grl_youtube_source_slow_keys (GrlMetadataSource *source);
+static const GList *grl_youtube_source_slow_keys (GrlSource *source);
 
-static GrlCaps * grl_youtube_source_get_caps (GrlMetadataSource *source,
+static GrlCaps * grl_youtube_source_get_caps (GrlSource *source,
                                               GrlSupportedOps operation);
 
 static void grl_youtube_source_search (GrlMediaSource *source,
@@ -211,7 +211,7 @@ static gboolean grl_youtube_test_media_from_uri (GrlMediaSource *source,
 static void grl_youtube_get_media_from_uri (GrlMediaSource *source,
 					    GrlMediaSourceMediaFromUriSpec *mfus);
 
-static void grl_youtube_source_cancel (GrlMetadataSource *source,
+static void grl_youtube_source_cancel (GrlSource *source,
                                        guint operation_id);
 
 static void produce_from_directory (CategoryInfo *dir, gint dir_size, OperationSpec *os);
@@ -247,7 +247,7 @@ static GrlYoutubeSource *ytsrc = NULL;
 
 gboolean
 grl_youtube_plugin_init (GrlPluginRegistry *registry,
-                         const GrlPluginInfo *plugin,
+                         GrlPlugin *plugin,
                          GList *configs)
 {
   gchar *api_key;
@@ -287,7 +287,7 @@ grl_youtube_plugin_init (GrlPluginRegistry *registry,
 
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
 
   g_free (api_key);
@@ -348,21 +348,25 @@ grl_youtube_source_new (const gchar *api_key, const gchar *client_id)
 static void
 grl_youtube_source_class_init (GrlYoutubeSourceClass * klass)
 {
-  GrlMediaSourceClass *source_class = GRL_MEDIA_SOURCE_CLASS (klass);
-  GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  source_class->search = grl_youtube_source_search;
-  source_class->browse = grl_youtube_source_browse;
-  source_class->metadata = grl_youtube_source_metadata;
-  source_class->test_media_from_uri = grl_youtube_test_media_from_uri;
-  source_class->media_from_uri = grl_youtube_get_media_from_uri;
-  metadata_class->supported_keys = grl_youtube_source_supported_keys;
-  metadata_class->slow_keys = grl_youtube_source_slow_keys;
-  metadata_class->get_caps = grl_youtube_source_get_caps;
-  metadata_class->cancel = grl_youtube_source_cancel;
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
+  GrlMediaSourceClass *media_class = GRL_MEDIA_SOURCE_CLASS (klass);
+
   gobject_class->set_property = grl_youtube_source_set_property;
   gobject_class->finalize = grl_youtube_source_finalize;
 
+  source_class->supported_keys = grl_youtube_source_supported_keys;
+  source_class->slow_keys = grl_youtube_source_slow_keys;
+  source_class->get_caps = grl_youtube_source_get_caps;
+  source_class->cancel = grl_youtube_source_cancel;
+
+  media_class->search = grl_youtube_source_search;
+  media_class->browse = grl_youtube_source_browse;
+  media_class->metadata = grl_youtube_source_metadata;
+  media_class->test_media_from_uri = grl_youtube_test_media_from_uri;
+  media_class->media_from_uri = grl_youtube_get_media_from_uri;
+
+
   g_object_class_install_property (gobject_class,
                                    PROP_SERVICE,
                                    g_param_spec_object ("yt-service",
@@ -1293,7 +1297,7 @@ media_from_uri_cb (GObject *object, GAsyncResult *result, gpointer user_data)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_youtube_source_supported_keys (GrlMetadataSource *source)
+grl_youtube_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1316,7 +1320,7 @@ grl_youtube_source_supported_keys (GrlMetadataSource *source)
 }
 
 static const GList *
-grl_youtube_source_slow_keys (GrlMetadataSource *source)
+grl_youtube_source_slow_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1586,7 +1590,7 @@ grl_youtube_get_media_from_uri (GrlMediaSource *source,
 }
 
 static void
-grl_youtube_source_cancel (GrlMetadataSource *source,
+grl_youtube_source_cancel (GrlSource *source,
                            guint operation_id)
 {
   GCancellable *cancellable;
@@ -1601,7 +1605,7 @@ grl_youtube_source_cancel (GrlMetadataSource *source,
 }
 
 static GrlCaps *
-grl_youtube_source_get_caps (GrlMetadataSource *source,
+grl_youtube_source_get_caps (GrlSource *source,
                              GrlSupportedOps operation)
 {
   static GrlCaps *caps = NULL;
diff --git a/src/metadata/fake-metadata/grl-fake-metadata.c b/src/metadata/fake-metadata/grl-fake-metadata.c
index 552f16d..e738444 100644
--- a/src/metadata/fake-metadata/grl-fake-metadata.c
+++ b/src/metadata/fake-metadata/grl-fake-metadata.c
@@ -45,7 +45,7 @@ static void grl_fake_metadata_source_resolve (GrlMetadataSource *source,
 static void grl_fake_metadata_source_set_metadata (GrlMetadataSource *source,
 						   GrlMetadataSourceSetMetadataSpec *sms);
 
-static const GList *grl_fake_metadata_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_fake_metadata_source_supported_keys (GrlSource *source);
 
 static gboolean grl_fake_metadata_source_may_resolve (GrlMetadataSource *source,
                                                       GrlMedia *media,
@@ -55,7 +55,7 @@ static gboolean grl_fake_metadata_source_may_resolve (GrlMetadataSource *source,
 static const GList *grl_fake_metadata_source_writable_keys (GrlMetadataSource *source);
 
 gboolean grl_fake_metadata_source_plugin_init (GrlPluginRegistry *registry,
-                                               const GrlPluginInfo *plugin,
+                                               GrlPlugin *plugin,
                                                GList *configs);
 
 
@@ -63,7 +63,7 @@ gboolean grl_fake_metadata_source_plugin_init (GrlPluginRegistry *registry,
 
 gboolean
 grl_fake_metadata_source_plugin_init (GrlPluginRegistry *registry,
-                                      const GrlPluginInfo *plugin,
+                                      GrlPlugin *plugin,
                                       GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (fake_metadata_log_domain, "fake-metadata");
@@ -73,7 +73,7 @@ grl_fake_metadata_source_plugin_init (GrlPluginRegistry *registry,
   GrlFakeMetadataSource *source = grl_fake_metadata_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -98,8 +98,11 @@ grl_fake_metadata_source_new (void)
 static void
 grl_fake_metadata_source_class_init (GrlFakeMetadataSourceClass * klass)
 {
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
-  metadata_class->supported_keys = grl_fake_metadata_source_supported_keys;
+
+  source_class->supported_keys = grl_fake_metadata_source_supported_keys;
+
   metadata_class->may_resolve = grl_fake_metadata_source_may_resolve;
   metadata_class->resolve = grl_fake_metadata_source_resolve;
   metadata_class->set_metadata = grl_fake_metadata_source_set_metadata;
@@ -150,7 +153,7 @@ fill_metadata (GrlMedia *media, GrlKeyID key_id)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_fake_metadata_source_supported_keys (GrlMetadataSource *source)
+grl_fake_metadata_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
diff --git a/src/metadata/gravatar/grl-gravatar.c b/src/metadata/gravatar/grl-gravatar.c
index 8138c97..89d849c 100644
--- a/src/metadata/gravatar/grl-gravatar.c
+++ b/src/metadata/gravatar/grl-gravatar.c
@@ -50,7 +50,7 @@ static GrlGravatarSource *grl_gravatar_source_new (void);
 static void grl_gravatar_source_resolve (GrlMetadataSource *source,
                                          GrlMetadataSourceResolveSpec *rs);
 
-static const GList *grl_gravatar_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_gravatar_source_supported_keys (GrlSource *source);
 
 static gboolean grl_gravatar_source_may_resolve (GrlMetadataSource *source,
                                                  GrlMedia *media,
@@ -63,7 +63,7 @@ static GrlKeyID register_gravatar_key (GrlPluginRegistry *registry,
                                        const gchar *blurb);
 
 gboolean grl_gravatar_source_plugin_init (GrlPluginRegistry *registry,
-                                          const GrlPluginInfo *plugin,
+                                          GrlPlugin *plugin,
                                           GList *configs);
 
 GrlKeyID GRL_METADATA_KEY_ARTIST_AVATAR = 0;
@@ -73,7 +73,7 @@ GrlKeyID GRL_METADATA_KEY_AUTHOR_AVATAR = 0;
 
 gboolean
 grl_gravatar_source_plugin_init (GrlPluginRegistry *registry,
-                                 const GrlPluginInfo *plugin,
+                                 GrlPlugin *plugin,
                                  GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (gravatar_log_domain, "gravatar");
@@ -110,7 +110,7 @@ grl_gravatar_source_plugin_init (GrlPluginRegistry *registry,
   GrlGravatarSource *source = grl_gravatar_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -135,8 +135,11 @@ grl_gravatar_source_new (void)
 static void
 grl_gravatar_source_class_init (GrlGravatarSourceClass * klass)
 {
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
-  metadata_class->supported_keys = grl_gravatar_source_supported_keys;
+
+  source_class->supported_keys = grl_gravatar_source_supported_keys;
+
   metadata_class->may_resolve = grl_gravatar_source_may_resolve;
   metadata_class->resolve = grl_gravatar_source_resolve;
 }
@@ -253,7 +256,7 @@ set_avatar (GrlData *data,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_gravatar_source_supported_keys (GrlMetadataSource *source)
+grl_gravatar_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
 
diff --git a/src/metadata/lastfm-albumart/grl-lastfm-albumart.c b/src/metadata/lastfm-albumart/grl-lastfm-albumart.c
index 6374345..4abad93 100644
--- a/src/metadata/lastfm-albumart/grl-lastfm-albumart.c
+++ b/src/metadata/lastfm-albumart/grl-lastfm-albumart.c
@@ -65,18 +65,18 @@ static void grl_lastfm_albumart_source_finalize (GObject *object);
 static void grl_lastfm_albumart_source_resolve (GrlMetadataSource *source,
                                                 GrlMetadataSourceResolveSpec *rs);
 
-static const GList *grl_lastfm_albumart_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_lastfm_albumart_source_supported_keys (GrlSource *source);
 
 static gboolean grl_lastfm_albumart_source_may_resolve (GrlMetadataSource *source,
                                                         GrlMedia *media,
                                                         GrlKeyID key_id,
                                                         GList **missing_keys);
 
-static void grl_lastfm_albumart_source_cancel (GrlMetadataSource *source,
+static void grl_lastfm_albumart_source_cancel (GrlSource *source,
                                                guint operation_id);
 
 gboolean grl_lastfm_albumart_source_plugin_init (GrlPluginRegistry *registry,
-                                                 const GrlPluginInfo *plugin,
+                                                 GrlPlugin *plugin,
                                                  GList *configs);
 
 
@@ -84,7 +84,7 @@ gboolean grl_lastfm_albumart_source_plugin_init (GrlPluginRegistry *registry,
 
 gboolean
 grl_lastfm_albumart_source_plugin_init (GrlPluginRegistry *registry,
-                                        const GrlPluginInfo *plugin,
+                                        GrlPlugin *plugin,
                                         GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (lastfm_albumart_log_domain, "lastfm-albumart");
@@ -94,7 +94,7 @@ grl_lastfm_albumart_source_plugin_init (GrlPluginRegistry *registry,
   GrlLastfmAlbumartSource *source = grl_lastfm_albumart_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -119,13 +119,16 @@ grl_lastfm_albumart_source_new (void)
 static void
 grl_lastfm_albumart_source_class_init (GrlLastfmAlbumartSourceClass * klass)
 {
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
-  metadata_class->supported_keys = grl_lastfm_albumart_source_supported_keys;
+
+  source_class->supported_keys = grl_lastfm_albumart_source_supported_keys;
+  source_class->cancel = grl_lastfm_albumart_source_cancel;
+
   metadata_class->may_resolve = grl_lastfm_albumart_source_may_resolve;
   metadata_class->resolve = grl_lastfm_albumart_source_resolve;
-  metadata_class->cancel = grl_lastfm_albumart_source_cancel;
 
-  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   gobject_class->finalize = grl_lastfm_albumart_source_finalize;
 }
 
@@ -292,7 +295,7 @@ read_url_async (GrlMetadataSource *source,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_lastfm_albumart_source_supported_keys (GrlMetadataSource *source)
+grl_lastfm_albumart_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
 
@@ -392,7 +395,7 @@ grl_lastfm_albumart_source_resolve (GrlMetadataSource *source,
 }
 
 static void
-grl_lastfm_albumart_source_cancel (GrlMetadataSource *source,
+grl_lastfm_albumart_source_cancel (GrlSource *source,
                                    guint operation_id)
 {
   GCancellable *cancellable =
diff --git a/src/metadata/local-metadata/grl-local-metadata.c b/src/metadata/local-metadata/grl-local-metadata.c
index 3f90928..514c011 100644
--- a/src/metadata/local-metadata/grl-local-metadata.c
+++ b/src/metadata/local-metadata/grl-local-metadata.c
@@ -104,19 +104,19 @@ static GrlLocalMetadataSource *grl_local_metadata_source_new (gboolean guess_vid
 static void grl_local_metadata_source_resolve (GrlMetadataSource *source,
                                               GrlMetadataSourceResolveSpec *rs);
 
-static const GList *grl_local_metadata_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_local_metadata_source_supported_keys (GrlSource *source);
 
 static gboolean grl_local_metadata_source_may_resolve (GrlMetadataSource *source,
                                                        GrlMedia *media,
                                                        GrlKeyID key_id,
                                                        GList **missing_keys);
 
-static void grl_local_metadata_source_cancel (GrlMetadataSource *source,
+static void grl_local_metadata_source_cancel (GrlSource *source,
                                               guint operation_id);
 
 gboolean grl_local_metadata_source_plugin_init (GrlPluginRegistry *registry,
-                                               const GrlPluginInfo *plugin,
-                                               GList *configs);
+                                                GrlPlugin *plugin,
+                                                GList *configs);
 
 /**/
 
@@ -124,8 +124,8 @@ gboolean grl_local_metadata_source_plugin_init (GrlPluginRegistry *registry,
 
 gboolean
 grl_local_metadata_source_plugin_init (GrlPluginRegistry *registry,
-                                      const GrlPluginInfo *plugin,
-                                      GList *configs)
+                                       GrlPlugin *plugin,
+                                       GList *configs)
 {
   guint config_count;
   gboolean guess_video = TRUE;
@@ -151,7 +151,7 @@ grl_local_metadata_source_plugin_init (GrlPluginRegistry *registry,
   GrlLocalMetadataSource *source = grl_local_metadata_source_new (guess_video);
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -178,14 +178,16 @@ static void
 grl_local_metadata_source_class_init (GrlLocalMetadataSourceClass * klass)
 {
   GObjectClass           *g_class        = G_OBJECT_CLASS (klass);
+  GrlSourceClass         *source_class   = GRL_SOURCE_CLASS (klass);
   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
 
-  metadata_class->supported_keys = grl_local_metadata_source_supported_keys;
+  g_class->set_property = grl_local_metadata_source_set_property;
+
+  source_class->supported_keys = grl_local_metadata_source_supported_keys;
+  source_class->cancel = grl_local_metadata_source_cancel;
+
   metadata_class->may_resolve = grl_local_metadata_source_may_resolve;
   metadata_class->resolve = grl_local_metadata_source_resolve;
-  metadata_class->cancel = grl_local_metadata_source_cancel;
-
-  g_class->set_property = grl_local_metadata_source_set_property;
 
   g_object_class_install_property (g_class,
                                    PROP_GUESS_VIDEO,
@@ -853,7 +855,7 @@ get_resolution_flags (GList *keys)
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_local_metadata_source_supported_keys (GrlMetadataSource *source)
+grl_local_metadata_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -1011,7 +1013,7 @@ grl_local_metadata_source_resolve (GrlMetadataSource *source,
 }
 
 static void
-grl_local_metadata_source_cancel (GrlMetadataSource *source,
+grl_local_metadata_source_cancel (GrlSource *source,
                                   guint operation_id)
 {
   GCancellable *cancellable =
diff --git a/src/metadata/metadata-store/grl-metadata-store.c b/src/metadata/metadata-store/grl-metadata-store.c
index 5a67aae..3b14c33 100644
--- a/src/metadata/metadata-store/grl-metadata-store.c
+++ b/src/metadata/metadata-store/grl-metadata-store.c
@@ -92,25 +92,25 @@ static void grl_metadata_store_source_resolve (GrlMetadataSource *source,
 static void grl_metadata_store_source_set_metadata (GrlMetadataSource *source,
 						    GrlMetadataSourceSetMetadataSpec *sms);
 
-static const GList *grl_metadata_store_source_supported_keys (GrlMetadataSource *source);
+static const GList *grl_metadata_store_source_supported_keys (GrlSource *source);
 
 static gboolean grl_metadata_store_source_may_resolve (GrlMetadataSource *source,
                                                        GrlMedia *media,
                                                        GrlKeyID key_id,
                                                        GList **missing_keys);
 
-static const GList *grl_metadata_store_source_writable_keys (GrlMetadataSource *source);
+static const GList *grl_metadata_store_source_writable_keys (GrlSource *source);
 
 gboolean grl_metadata_store_source_plugin_init (GrlPluginRegistry *registry,
-						const GrlPluginInfo *plugin,
-						GList *configs);
+                                                GrlPlugin *plugin,
+                                                GList *configs);
 
 
 /* =================== GrlMetadataStore Plugin  =============== */
 
 gboolean
 grl_metadata_store_source_plugin_init (GrlPluginRegistry *registry,
-                                      const GrlPluginInfo *plugin,
+                                      GrlPlugin *plugin,
                                       GList *configs)
 {
   GRL_LOG_DOMAIN_INIT (metadata_store_log_domain, "metadata-store");
@@ -120,7 +120,7 @@ grl_metadata_store_source_plugin_init (GrlPluginRegistry *registry,
   GrlMetadataStoreSource *source = grl_metadata_store_source_new ();
   grl_plugin_registry_register_source (registry,
                                        plugin,
-                                       GRL_MEDIA_PLUGIN (source),
+                                       GRL_SOURCE (source),
                                        NULL);
   return TRUE;
 }
@@ -145,10 +145,13 @@ grl_metadata_store_source_new (void)
 static void
 grl_metadata_store_source_class_init (GrlMetadataStoreSourceClass * klass)
 {
+  GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
-  metadata_class->supported_keys = grl_metadata_store_source_supported_keys;
+
+  source_class->supported_keys = grl_metadata_store_source_supported_keys;
+  source_class->writable_keys = grl_metadata_store_source_writable_keys;
+
   metadata_class->may_resolve = grl_metadata_store_source_may_resolve;
-  metadata_class->writable_keys = grl_metadata_store_source_writable_keys;
   metadata_class->resolve = grl_metadata_store_source_resolve;
   metadata_class->set_metadata = grl_metadata_store_source_set_metadata;
 
@@ -528,7 +531,7 @@ write_keys (sqlite3 *db,
 /* ================== API Implementation ================ */
 
 static const GList *
-grl_metadata_store_source_supported_keys (GrlMetadataSource *source)
+grl_metadata_store_source_supported_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
@@ -542,7 +545,7 @@ grl_metadata_store_source_supported_keys (GrlMetadataSource *source)
 }
 
 static const GList *
-grl_metadata_store_source_writable_keys (GrlMetadataSource *source)
+grl_metadata_store_source_writable_keys (GrlSource *source)
 {
   static GList *keys = NULL;
   if (!keys) {
diff --git a/test/main.c b/test/main.c
index 2d829ce..160f9d7 100644
--- a/test/main.c
+++ b/test/main.c
@@ -31,12 +31,12 @@ GRL_LOG_DOMAIN_STATIC(test_main_log_domain);
 #define YOUTUBE_KEY "AI39si4EfscPllSfUy1IwexMf__kntTL_G5dfSr2iUEVN45RHGq92Aq0lX25OlnOkG6KTN-4soVAkAf67fWYXuHfVADZYr7S1A"
 
 static void
-print_supported_ops (GrlMetadataSource *source)
+print_supported_ops (GrlSource *source)
 {
   GRL_DEBUG ("  Operations available in '%s'",
-             grl_metadata_source_get_name (source));
+             grl_source_get_name (source));
 
-  GrlSupportedOps caps = grl_metadata_source_supported_operations (source);
+  GrlSupportedOps caps = grl_source_supported_operations (source);
 
   if (caps & GRL_OP_METADATA) {
     GRL_DEBUG ("    + Metadata");
@@ -329,15 +329,15 @@ main (void)
   g_assert (podcasts);
   GRL_DEBUG ("Supported operations");
 
-  print_supported_ops (GRL_METADATA_SOURCE (youtube));
-  print_supported_ops (GRL_METADATA_SOURCE (fs));
-  if (flickr) print_supported_ops (GRL_METADATA_SOURCE (flickr));
-  print_supported_ops (GRL_METADATA_SOURCE (jamendo));
-  print_supported_ops (GRL_METADATA_SOURCE (apple_trailers));
-  print_supported_ops (GRL_METADATA_SOURCE (shoutcast));
+  print_supported_ops (GRL_SOURCE (youtube));
+  print_supported_ops (GRL_SOURCE (fs));
+  if (flickr) print_supported_ops (GRL_SOURCE (flickr));
+  print_supported_ops (GRL_SOURCE (jamendo));
+  print_supported_ops (GRL_SOURCE (apple_trailers));
+  print_supported_ops (GRL_SOURCE (shoutcast));
   if (fake) print_supported_ops (fake);
-  print_supported_ops (GRL_METADATA_SOURCE (podcasts));
-  print_supported_ops (GRL_METADATA_SOURCE (bookmarks));
+  print_supported_ops (GRL_SOURCE (podcasts));
+  print_supported_ops (GRL_SOURCE (bookmarks));
   print_supported_ops (lastfm);
   print_supported_ops (metadata_store);
 



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