From fc8e3ad269d312dc3c635690e0502821f05a5724 Mon Sep 17 00:00:00 2001 From: anurse Date: Mon, 7 Jul 2014 14:26:44 -0700 Subject: [PATCH] Fixed reference to "items" property in JSON --- src/Catalog/Collecting/BatchCollector.cs | 4 ++-- src/Catalog/Collecting/Test/CountCollector.cs | 2 +- tests/CatalogTests/CatalogTests.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Catalog/Collecting/BatchCollector.cs b/src/Catalog/Collecting/BatchCollector.cs index 9e312291f..0a9ce5abe 100644 --- a/src/Catalog/Collecting/BatchCollector.cs +++ b/src/Catalog/Collecting/BatchCollector.cs @@ -36,7 +36,7 @@ protected override async Task Fetch(CollectorHttpClient client, JToken context = null; root.TryGetValue("@context", out context); - IEnumerable rootItems = root["item"].OrderBy(item => item["commitTimestamp"].ToObject()); + IEnumerable rootItems = root["items"].OrderBy(item => item["commitTimestamp"].ToObject()); foreach (JObject rootItem in rootItems) { @@ -47,7 +47,7 @@ protected override async Task Fetch(CollectorHttpClient client, Uri pageUri = rootItem["url"].ToObject(); JObject page = await client.GetJObjectAsync(pageUri); - IEnumerable pageItems = page["item"].OrderBy(item => item["commitTimestamp"].ToObject()); + IEnumerable pageItems = page["items"].OrderBy(item => item["commitTimestamp"].ToObject()); foreach (JObject pageItem in pageItems) { diff --git a/src/Catalog/Collecting/Test/CountCollector.cs b/src/Catalog/Collecting/Test/CountCollector.cs index af8fe10d0..3524711a8 100644 --- a/src/Catalog/Collecting/Test/CountCollector.cs +++ b/src/Catalog/Collecting/Test/CountCollector.cs @@ -28,7 +28,7 @@ protected override async Task Fetch(CollectorHttpClient client, List> tasks = new List>(); - foreach (JObject rootItem in root["item"]) + foreach (JObject rootItem in root["items"]) { DateTime pageTimeStamp = rootItem["commitTimestamp"].ToObject(); diff --git a/tests/CatalogTests/CatalogTests.cs b/tests/CatalogTests/CatalogTests.cs index 4d087672e..897d4d915 100644 --- a/tests/CatalogTests/CatalogTests.cs +++ b/tests/CatalogTests/CatalogTests.cs @@ -24,7 +24,7 @@ public async Task Test0Async() string indexJson = await client.GetStringAsync(address); JObject indexObj = JObject.Parse(indexJson); - foreach (JToken indexItem in indexObj["item"]) + foreach (JToken indexItem in indexObj["items"]) { DateTime indexItemTimeStamp = indexItem["commitTimestamp"].ToObject(); @@ -33,7 +33,7 @@ public async Task Test0Async() string pageJson = await client.GetStringAsync(indexItem["url"].ToObject()); JObject pageObj = JObject.Parse(pageJson); - foreach (JToken pageItem in pageObj["item"]) + foreach (JToken pageItem in pageObj["items"]) { DateTime pageItemTimeStamp = pageItem["commitTimestamp"].ToObject();