[frogr] Report error when the video quota for upload has been exceeded.



commit cb645a66fa51ad6b980da9063f7ee5388ef7a038
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sat Nov 3 19:08:19 2012 +0100

    Report error when the video quota for upload has been exceeded.
    
    This quota for videos is different than from photos, so we need
    to treat those two cases separately.

 src/flicksoup/fsp-error.c |   20 ++++++++++----------
 src/flicksoup/fsp-error.h |    3 ++-
 src/frogr-controller.c    |    9 +++++++--
 3 files changed, 19 insertions(+), 13 deletions(-)
---
diff --git a/src/flicksoup/fsp-error.c b/src/flicksoup/fsp-error.c
index 6067d76..c23cb44 100644
--- a/src/flicksoup/fsp-error.c
+++ b/src/flicksoup/fsp-error.c
@@ -25,16 +25,16 @@
 #define N_ERRORS (N_SPECIFIC_ERRORS + N_GENERAL_ERRORS)
 
 static const FspError photo_upload_translations [N_SPECIFIC_ERRORS] = {
-  FSP_ERROR_UNKNOWN,                    /* 0 */
-  FSP_ERROR_UNKNOWN,                    /* 1 */
-  FSP_ERROR_UPLOAD_MISSING_PHOTO,       /* 2 */
-  FSP_ERROR_UPLOAD_GENERAL_FAILURE,     /* 3 */
-  FSP_ERROR_UPLOAD_INVALID_FILE,        /* 4 */
-  FSP_ERROR_UPLOAD_INVALID_FILE,        /* 5 */
-  FSP_ERROR_UPLOAD_QUOTA_EXCEEDED,      /* 6 */
-  FSP_ERROR_UNKNOWN,                    /* 7 */
-  FSP_ERROR_UNKNOWN,                    /* 8 */
-  FSP_ERROR_UNKNOWN,                    /* 9 */
+  FSP_ERROR_UNKNOWN,                     /* 0 */
+  FSP_ERROR_UNKNOWN,                     /* 1 */
+  FSP_ERROR_UPLOAD_MISSING_PHOTO,        /* 2 */
+  FSP_ERROR_UPLOAD_GENERAL_FAILURE,      /* 3 */
+  FSP_ERROR_UPLOAD_INVALID_FILE,         /* 4 */
+  FSP_ERROR_UPLOAD_INVALID_FILE,         /* 5 */
+  FSP_ERROR_UPLOAD_QUOTA_PHOTO_EXCEEDED, /* 6 */
+  FSP_ERROR_UPLOAD_QUOTA_VIDEO_EXCEEDED, /* 7 */
+  FSP_ERROR_UNKNOWN,                     /* 8 */
+  FSP_ERROR_UNKNOWN,                     /* 9 */
 };
 
 static const FspError photo_get_info_translations [N_SPECIFIC_ERRORS] = {
diff --git a/src/flicksoup/fsp-error.h b/src/flicksoup/fsp-error.h
index 0279a0d..449b045 100644
--- a/src/flicksoup/fsp-error.h
+++ b/src/flicksoup/fsp-error.h
@@ -47,7 +47,8 @@ typedef enum {
   FSP_ERROR_UPLOAD_MISSING_PHOTO,
   FSP_ERROR_UPLOAD_GENERAL_FAILURE,
   FSP_ERROR_UPLOAD_INVALID_FILE,
-  FSP_ERROR_UPLOAD_QUOTA_EXCEEDED,
+  FSP_ERROR_UPLOAD_QUOTA_PHOTO_EXCEEDED,
+  FSP_ERROR_UPLOAD_QUOTA_VIDEO_EXCEEDED,
 
   FSP_ERROR_PHOTO_NOT_FOUND,
 
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 6fe4a5b..2ff4b0e 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -310,10 +310,14 @@ _handle_flicksoup_error (FrogrController *self, GError *error, gboolean notify_u
       msg = g_strdup (_("Error uploading picture:\nFile invalid"));
       break;
 
-    case FSP_ERROR_UPLOAD_QUOTA_EXCEEDED:
+    case FSP_ERROR_UPLOAD_QUOTA_PHOTO_EXCEEDED:
       msg = g_strdup (_("Error uploading picture:\nQuota exceeded"));
       break;
 
+    case FSP_ERROR_UPLOAD_QUOTA_VIDEO_EXCEEDED:
+      msg = g_strdup (_("Error uploading video:\nQuota exceeded"));
+      break;
+
     case FSP_ERROR_PHOTO_NOT_FOUND:
       msg = g_strdup (_("Error:\nPhoto not found"));
       break;
@@ -595,7 +599,8 @@ _should_retry_operation (GError *error, gint attempts)
 {
   if (error->code == FSP_ERROR_CANCELLED
       || error->code == FSP_ERROR_UPLOAD_INVALID_FILE
-      || error->code == FSP_ERROR_UPLOAD_QUOTA_EXCEEDED
+      || error->code == FSP_ERROR_UPLOAD_QUOTA_PHOTO_EXCEEDED
+      || error->code == FSP_ERROR_UPLOAD_QUOTA_VIDEO_EXCEEDED
       || error->code == FSP_ERROR_OAUTH_NOT_AUTHORIZED_YET
       || error->code == FSP_ERROR_NOT_AUTHENTICATED
       || error->code == FSP_ERROR_NOT_ENOUGH_PERMISSIONS



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