[grilo] core: Add a list of metadata keys as input parameter for
- From: Iago Toral Quiroga <itoral src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] core: Add a list of metadata keys as input parameter for
- Date: Mon, 13 Dec 2010 11:47:23 +0000 (UTC)
commit c6c8b38688091b4ea9f5809a125405291a6516d8
Author: Iago Toral Quiroga <itoral igalia com>
Date: Thu Dec 2 19:03:00 2010 +0100
core: Add a list of metadata keys as input parameter for
the media_from_site API.
https://bugzilla.gnome.org/show_bug.cgi?id=635394
src/grl-media-source.c | 5 +++++
src/grl-media-source.h | 3 +++
src/grl-multiple.c | 4 ++++
src/grl-multiple.h | 1 +
4 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index cc317ea..cbc74d5 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -567,6 +567,7 @@ media_from_site_relay_cb (GrlMediaSource *source,
g_object_unref (mfsrc->spec->source);
g_free (mfsrc->spec->site_uri);
+ g_list_free (mfsrc->spec->keys);
g_free (mfsrc->spec);
g_free (mfsrc);
}
@@ -2331,6 +2332,7 @@ grl_media_source_test_media_from_site (GrlMediaSource *source,
* grl_media_source_get_media_from_site:
* @source: a media source
* @site_uri: The media site URI
+ * @keys: A list of keys to resolve
* @callback: (scope notified): the user defined callback
* @user_data: the user data to pass in the callback
*
@@ -2346,6 +2348,7 @@ grl_media_source_test_media_from_site (GrlMediaSource *source,
void
grl_media_source_get_media_from_site (GrlMediaSource *source,
const gchar *site_uri,
+ const GList *keys,
GrlMediaSourceMetadataCb callback,
gpointer user_data)
{
@@ -2356,6 +2359,7 @@ grl_media_source_get_media_from_site (GrlMediaSource *source,
g_return_if_fail (GRL_IS_MEDIA_SOURCE (source));
g_return_if_fail (site_uri != NULL);
+ g_return_if_fail (keys != NULL);
g_return_if_fail (callback != NULL);
g_return_if_fail (grl_metadata_source_supported_operations (GRL_METADATA_SOURCE (source)) &
GRL_OP_MEDIA_FROM_SITE);
@@ -2371,6 +2375,7 @@ grl_media_source_get_media_from_site (GrlMediaSource *source,
mfss = g_new0 (GrlMediaSourceMediaFromSiteSpec, 1);
mfss->source = g_object_ref (source);
mfss->site_uri = g_strdup (site_uri);
+ mfss->keys = (GList *) g_list_copy (keys);
mfss->callback = media_from_site_relay_cb;
mfss->user_data = mfsrc;
diff --git a/src/grl-media-source.h b/src/grl-media-source.h
index df91974..764257e 100644
--- a/src/grl-media-source.h
+++ b/src/grl-media-source.h
@@ -288,6 +288,7 @@ typedef struct {
* GrlMediaSourceMediaFromSiteSpec:
* @source: a media source
* @site_uri: The site media URI
+ * @keys: Metadata keys to resolve
* @callback: the user defined callback
* @user_data: the user data to pass in the callback
*
@@ -297,6 +298,7 @@ typedef struct {
typedef struct {
GrlMediaSource *source;
gchar *site_uri;
+ GList *keys;
GrlMediaSourceMetadataCb callback;
gpointer user_data;
} GrlMediaSourceMediaFromSiteSpec;
@@ -460,6 +462,7 @@ gboolean grl_media_source_test_media_from_site (GrlMediaSource *source,
void grl_media_source_get_media_from_site (GrlMediaSource *source,
const gchar *site_uri,
+ const GList *keys,
GrlMediaSourceMetadataCb callback,
gpointer user_data);
diff --git a/src/grl-multiple.c b/src/grl-multiple.c
index d342797..651ed0e 100644
--- a/src/grl-multiple.c
+++ b/src/grl-multiple.c
@@ -663,6 +663,7 @@ grl_multiple_search_sync (const GList *sources,
/**
* grl_multiple_get_media_from_site:
* @site_uri: Site URI where the media is exposed.
+ * @keys: List of metadata keys we want to obtain.
* @callback: (scope notified): the user defined callback
* @user_data: the user data to pass to the user callback
*
@@ -674,6 +675,7 @@ grl_multiple_search_sync (const GList *sources,
*/
void
grl_multiple_get_media_from_site (const gchar *site_uri,
+ const GList *keys,
GrlMediaSourceMetadataCb callback,
gpointer user_data)
{
@@ -682,6 +684,7 @@ grl_multiple_get_media_from_site (const gchar *site_uri,
gboolean found = FALSE;
g_return_if_fail (site_uri != NULL);
+ g_return_if_fail (keys != NULL);
g_return_if_fail (callback != NULL);
registry = grl_plugin_registry_get_default ();
@@ -704,6 +707,7 @@ grl_multiple_get_media_from_site (const gchar *site_uri,
grl_media_source_get_media_from_site (source,
site_uri,
+ keys,
media_from_site_cb,
mfscd);
found = TRUE;
diff --git a/src/grl-multiple.h b/src/grl-multiple.h
index 1bb9c44..8cc69c8 100644
--- a/src/grl-multiple.h
+++ b/src/grl-multiple.h
@@ -49,6 +49,7 @@ GList *grl_multiple_search_sync (const GList *sources,
void grl_multiple_cancel (guint search_id);
void grl_multiple_get_media_from_site (const gchar *site_uri,
+ const GList *keys,
GrlMediaSourceMetadataCb callback,
gpointer user_data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]