[librest] youtube-proxy: Added incomplete option.



commit 1a4acc9d57cc8c9640d3d380b053947d487ade8a
Author: Eitan Isaacson <eitan monotonous org>
Date:   Mon Mar 21 00:53:44 2011 -0700

    youtube-proxy: Added incomplete option.

 rest-extras/youtube-proxy.c |    8 ++++++--
 rest-extras/youtube-proxy.h |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)
---
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,



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