[frogr] Added extra fields in FspDataUploadStatus: bw_used_videos, bw_remaining_videos, and video_fs_max_kb.
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Added extra fields in FspDataUploadStatus: bw_used_videos, bw_remaining_videos, and video_fs_max_kb.
- Date: Sun, 4 Nov 2012 21:47:32 +0000 (UTC)
commit 8a0a72512825adb2cf29f2e47dd616680078e725
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Sat Nov 3 19:17:27 2012 +0100
Added extra fields in FspDataUploadStatus: bw_used_videos,
bw_remaining_videos, and video_fs_max_kb.
src/examples/example.c | 10 ++++++++--
src/flicksoup/fsp-data.c | 10 ++++++++--
src/flicksoup/fsp-data.h | 14 ++++++++++----
src/flicksoup/fsp-parser.c | 22 +++++++++++++++++++++-
src/frogr-controller.c | 2 +-
5 files changed, 48 insertions(+), 10 deletions(-)
---
diff --git a/src/examples/example.c b/src/examples/example.c
index 0658358..e1079e3 100644
--- a/src/examples/example.c
+++ b/src/examples/example.c
@@ -563,8 +563,14 @@ get_upload_status_cb (GObject *object, GAsyncResult *res, gpointer unused)
upload_status->bw_used_kb);
g_print ("[get_upload_status_cb]::\tBandwitdh Remaining KB: %lu\n",
upload_status->bw_remaining_kb);
- g_print ("[get_upload_status_cb]::\tFilesize Max KB: %lu\n",
- upload_status->fs_max_kb);
+ g_print ("[get_upload_status_cb]::\tBandwitdh Used videos: %u\n",
+ upload_status->bw_used_videos);
+ g_print ("[get_upload_status_cb]::\tBandwitdh Remaining videos: %u\n",
+ upload_status->bw_remaining_videos);
+ g_print ("[get_upload_status_cb]::\tPhoto filesize Max KB: %lu\n",
+ upload_status->photo_fs_max_kb);
+ g_print ("[get_upload_status_cb]::\tVideo filesize Max KB: %lu\n",
+ upload_status->video_fs_max_kb);
/* Make a pause before continuing */
g_print ("Press ENTER to continue...\n\n");
diff --git a/src/flicksoup/fsp-data.c b/src/flicksoup/fsp-data.c
index ef41341..13e8f0f 100644
--- a/src/flicksoup/fsp-data.c
+++ b/src/flicksoup/fsp-data.c
@@ -58,8 +58,11 @@ fsp_data_new (FspDataType type)
new_data->upload_status.pro_user = FALSE;
new_data->upload_status.bw_max_kb = G_MAXUINT32;
new_data->upload_status.bw_used_kb = G_MAXUINT32;
+ new_data->upload_status.bw_used_videos = G_MAXUINT;
+ new_data->upload_status.bw_remaining_videos = G_MAXUINT;
new_data->upload_status.bw_remaining_kb = G_MAXUINT32;
- new_data->upload_status.fs_max_kb = G_MAXUINT32;
+ new_data->upload_status.photo_fs_max_kb = G_MAXUINT32;
+ new_data->upload_status.video_fs_max_kb = G_MAXUINT32;
break;
case FSP_PHOTO_INFO:
@@ -141,7 +144,10 @@ fsp_data_copy (const FspData *data)
new_data->upload_status.bw_max_kb = data->upload_status.bw_max_kb;
new_data->upload_status.bw_used_kb = data->upload_status.bw_used_kb;
new_data->upload_status.bw_remaining_kb = data->upload_status.bw_remaining_kb;
- new_data->upload_status.fs_max_kb = data->upload_status.fs_max_kb;
+ new_data->upload_status.bw_used_videos = data->upload_status.bw_used_videos;
+ new_data->upload_status.bw_remaining_videos = data->upload_status.bw_remaining_videos;
+ new_data->upload_status.photo_fs_max_kb = data->upload_status.photo_fs_max_kb;
+ new_data->upload_status.video_fs_max_kb = data->upload_status.video_fs_max_kb;
break;
case FSP_PHOTO_INFO:
diff --git a/src/flicksoup/fsp-data.h b/src/flicksoup/fsp-data.h
index 8c12917..a714823 100644
--- a/src/flicksoup/fsp-data.h
+++ b/src/flicksoup/fsp-data.h
@@ -144,10 +144,16 @@ struct _FspDataUploadStatus
gchar *id;
gchar *username;
gboolean pro_user;
- gulong bw_max_kb; /* Bandwith max KB */
- gulong bw_used_kb; /* Bandwith used KB */
- gulong bw_remaining_kb; /* Bandwith remaining KB */
- gulong fs_max_kb; /* Filesize max KB */
+
+ gulong bw_max_kb; /* Bandwith max KB */
+ gulong bw_used_kb; /* Bandwith used KB */
+ gulong bw_remaining_kb; /* Bandwith remaining KB */
+
+ guint bw_used_videos; /* Current number of videos */
+ guint bw_remaining_videos; /* Remaining number of videos */
+
+ gulong photo_fs_max_kb; /* Filesize max KB */
+ gulong video_fs_max_kb; /* Filesize max KB */
};
struct _FspDataPhotoInfo
diff --git a/src/flicksoup/fsp-parser.c b/src/flicksoup/fsp-parser.c
index 2c7d7b0..2254496 100644
--- a/src/flicksoup/fsp-parser.c
+++ b/src/flicksoup/fsp-parser.c
@@ -554,7 +554,27 @@ _get_upload_status_parser (xmlDoc *doc,
if (!g_strcmp0 ((gchar *) node->name, "filesize"))
{
value = xmlGetProp (node, (const xmlChar *) "maxkb");
- upload_status->fs_max_kb = (gulong) g_ascii_strtoll ((gchar *) value, NULL, 10);
+ upload_status->photo_fs_max_kb = (gulong) g_ascii_strtoll ((gchar *) value, NULL, 10);
+ xmlFree (value);
+ }
+
+ /* Videosize */
+ if (!g_strcmp0 ((gchar *) node->name, "videosize"))
+ {
+ value = xmlGetProp (node, (const xmlChar *) "maxkb");
+ upload_status->video_fs_max_kb = (gulong) g_ascii_strtoll ((gchar *) value, NULL, 10);
+ xmlFree (value);
+ }
+
+ /* Videos */
+ if (!g_strcmp0 ((gchar *) node->name, "videos"))
+ {
+ value = xmlGetProp (node, (const xmlChar *) "remaining");
+ upload_status->bw_remaining_videos = (guint) g_ascii_strtoll ((gchar *) value, NULL, 10);
+ xmlFree (value);
+
+ value = xmlGetProp (node, (const xmlChar *) "uploaded");
+ upload_status->bw_used_videos = (guint) g_ascii_strtoll ((gchar *) value, NULL, 10);
xmlFree (value);
}
}
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index b6f6e60..50a275c 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -1638,7 +1638,7 @@ _fetch_account_extra_info_cb (GObject *object, GAsyncResult *res, gpointer data)
frogr_account_set_remaining_bandwidth (priv->account,
upload_status->bw_remaining_kb);
frogr_account_set_max_bandwidth (priv->account, upload_status->bw_max_kb);
- frogr_account_set_max_photo_filesize (priv->account, upload_status->fs_max_kb);
+ frogr_account_set_max_photo_filesize (priv->account, upload_status->photo_fs_max_kb);
frogr_account_set_is_pro (priv->account, upload_status->pro_user);
/* Mark that we received this extra info for the user */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]