[gnome-software/wip/rancell/reviews: 2/3] Fix storing of the Ubuntu review ID - it is an integer, not a string



commit faa1f16a90a7813a3f36a411980981edee1096a5
Author: William Hua <william hua canonical com>
Date:   Mon Feb 29 18:46:25 2016 -0500

    Fix storing of the Ubuntu review ID - it is an integer, not a string

 src/plugins/gs-plugin-ubuntu-reviews.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-ubuntu-reviews.c b/src/plugins/gs-plugin-ubuntu-reviews.c
index f61600a..476eee6 100644
--- a/src/plugins/gs-plugin-ubuntu-reviews.c
+++ b/src/plugins/gs-plugin-ubuntu-reviews.c
@@ -503,6 +503,7 @@ parse_review (JsonNode *node)
        GsReview *review;
        JsonObject *object;
        gint64 star_rating;
+       g_autofree gchar *id_string = NULL;
 
        if (!JSON_NODE_HOLDS_OBJECT (node))
                return NULL;
@@ -518,7 +519,8 @@ parse_review (JsonNode *node)
        if (star_rating > 0)
                gs_review_set_rating (review, star_rating * 20);
        gs_review_set_date (review, parse_date_time (json_object_get_string_member (object, "date_created")));
-       gs_review_add_metadata (review, "ubuntu-id", json_object_get_string_member (object, "id"));
+       id_string = g_strdup_printf ("%ld", json_object_get_int_member (object, "id"));
+       gs_review_add_metadata (review, "ubuntu-id", id_string);
 
        return review;
 }


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