From 1a4acc9d57cc8c9640d3d380b053947d487ade8a Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Mon, 21 Mar 2011 00:53:44 -0700 Subject: youtube-proxy: Added incomplete option. --- rest-extras/youtube-proxy.c | 8 ++++++-- rest-extras/youtube-proxy.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'rest-extras') diff --git a/rest-extras/youtube-proxy.c b/rest-extras/youtube-proxy.c index 9f9bedb..af39e20 100644 --- a/rest-extras/youtube-proxy.c +++ b/rest-extras/youtube-proxy.c @@ -160,7 +160,7 @@ youtube_proxy_set_user_auth (YoutubeProxy *proxy, } static gchar * -_construct_upload_atom_xml (GHashTable *fields) +_construct_upload_atom_xml (GHashTable *fields, gboolean incomplete) { GHashTableIter iter; gpointer key, value; @@ -175,6 +175,9 @@ _construct_upload_atom_xml (GHashTable *fields) rest_xml_node_add_attr (entry, "xmlns:yt", "http://gdata.youtube.com/schemas/2007"); + if (incomplete) + rest_xml_node_add_child (group, "yt:incomplete"); + g_hash_table_iter_init (&iter, fields); while (g_hash_table_iter_next (&iter, &key, &value)) { @@ -317,6 +320,7 @@ gboolean youtube_proxy_upload_async (YoutubeProxy *self, const gchar *filename, GHashTable *fields, + gboolean incomplete, YoutubeProxyUploadCallback callback, GObject *weak_object, gpointer userdata, @@ -339,7 +343,7 @@ youtube_proxy_upload_async (YoutubeProxy *self, mp = soup_multipart_new ("multipart/related"); - atom_xml = _construct_upload_atom_xml (fields); + atom_xml = _construct_upload_atom_xml (fields, incomplete); sb = soup_buffer_new_with_owner (atom_xml, strlen(atom_xml), diff --git a/rest-extras/youtube-proxy.h b/rest-extras/youtube-proxy.h index b2bde90..440fd6a 100644 --- a/rest-extras/youtube-proxy.h +++ b/rest-extras/youtube-proxy.h @@ -84,6 +84,7 @@ typedef void (*YoutubeProxyUploadCallback)(YoutubeProxy *proxy, gboolean youtube_proxy_upload_async (YoutubeProxy *self, const gchar *filename, GHashTable *fields, + gboolean incomplete, YoutubeProxyUploadCallback callback, GObject *weak_object, gpointer userdata, -- cgit v1.2.1