summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEitan Isaacson <eitan.isaacson@collabora.co.uk>2011-04-07 18:59:06 (GMT)
committerEitan Isaacson <eitan.isaacson@collabora.co.uk>2011-04-07 18:59:06 (GMT)
commitef41bbf61f4716dfed29c903d4d9878f355274db (patch)
tree5252d6a166c2447063a204ba32d000d354420887
parent511dbe9a5a39bfdfff960a5458fcb3ef6576d01b (diff)
downloadlibsocialweb-upload-progress.tar.gz
libsocialweb-upload-progress.tar.xz
youtube: Support upload progress.upload-progress
-rw-r--r--services/youtube/youtube.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/youtube/youtube.c b/services/youtube/youtube.c
index 676d02a..87b7ce2 100644
--- a/services/youtube/youtube.c
+++ b/services/youtube/youtube.c
@@ -481,6 +481,8 @@ query_iface_init (gpointer g_iface,
static void
_video_upload_cb (YoutubeProxy *proxy,
const gchar *payload,
+ gsize total,
+ gsize uploaded,
const GError *error,
GObject *weak_object,
gpointer user_data)
@@ -492,7 +494,8 @@ _video_upload_cb (YoutubeProxy *proxy,
sw_video_upload_iface_emit_video_upload_progress (self, opid, -1,
error->message);
} else {
- sw_video_upload_iface_emit_video_upload_progress (self, opid, 100, "");
+ gint percent = (gdouble) uploaded / (gdouble) total * 100;
+ sw_video_upload_iface_emit_video_upload_progress (self, opid, percent, "");
}
}