summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-06-20 18:23:30 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2011-06-20 18:23:30 +0100
commit05ba9e12ddcfb12bc2af695726e24712a2767ea0 (patch)
treef5dec4de54cc1f5022dd0d3bafb8bc82a2c26b14 /src
parent3783bfa81fc649d06bd426c7b8ba14abc608a5d2 (diff)
downloadtotem-05ba9e12ddcfb12bc2af695726e24712a2767ea0.tar.gz
youtube: Add optional support for compiling against libgdata 0.9.x
This migrates Totem to the API changes in libgdata 0.9.0 and (unreleased) 0.9.1 if they're available.
Diffstat (limited to 'src')
-rw-r--r--src/plugins/youtube/totem-youtube.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/youtube/totem-youtube.c b/src/plugins/youtube/totem-youtube.c
index 710ce752f..bc19a2a02 100644
--- a/src/plugins/youtube/totem-youtube.c
+++ b/src/plugins/youtube/totem-youtube.c
@@ -591,6 +591,17 @@ execute_query (TotemYouTubePlugin *self, guint tree_view, gboolean clear_tree_vi
if (clear_tree_view == TRUE)
gtk_list_store_clear (self->priv->list_store[tree_view]);
+#ifdef HAVE_LIBGDATA_0_9
+ if (tree_view == SEARCH_TREE_VIEW) {
+ gdata_youtube_service_query_videos_async (self->priv->service, self->priv->query[tree_view], data->query_cancellable,
+ (GDataQueryProgressCallback) query_progress_cb, data, NULL,
+ (GAsyncReadyCallback) query_finished_cb, data);
+ } else {
+ gdata_youtube_service_query_related_async (self->priv->service, self->priv->playing_video, self->priv->query[tree_view],
+ data->query_cancellable, (GDataQueryProgressCallback) query_progress_cb, data, NULL,
+ (GAsyncReadyCallback) query_finished_cb, data);
+ }
+#else
if (tree_view == SEARCH_TREE_VIEW) {
gdata_youtube_service_query_videos_async (self->priv->service, self->priv->query[tree_view], data->query_cancellable,
(GDataQueryProgressCallback) query_progress_cb, data,
@@ -600,6 +611,7 @@ execute_query (TotemYouTubePlugin *self, guint tree_view, gboolean clear_tree_vi
data->query_cancellable, (GDataQueryProgressCallback) query_progress_cb, data,
(GAsyncReadyCallback) query_finished_cb, data);
}
+#endif /* !HAVE_LIBGDATA_0_9 */
}
void
@@ -634,7 +646,11 @@ search_button_clicked_cb (GtkButton *button, TotemYouTubePlugin *self)
g_assert (priv->regex != NULL);
/* Set up the GData service (needed for the tree views' queries) */
+#ifdef HAVE_LIBGDATA_0_9
+ priv->service = gdata_youtube_service_new (DEVELOPER_KEY, NULL);
+#else
priv->service = gdata_youtube_service_new (DEVELOPER_KEY, CLIENT_ID);
+#endif /* !HAVE_LIBGDATA_0_9 */
/* Set up network timeouts, if they're supported by our version of libgdata.
* This will return from queries with %GDATA_SERVICE_ERROR_NETWORK_ERROR if network operations take longer than 30 seconds. */