forked from FarmMaps/FarmMapsApiClient
don't write duplicate KPIOutput items to output csv
This commit is contained in:
@@ -83,7 +83,7 @@ namespace FarmmapsKPI
|
||||
private async Task Process(List<UserRoot> roots, KPIInput input, StreamWriter sw)
|
||||
{
|
||||
KPIOutput kpio;
|
||||
KPIOutput kpioPrevious = null;
|
||||
KPIOutput kpioPrevious = new KPIOutput(); //creates a new empty
|
||||
|
||||
string downloadFolder = input.DownloadFolder;
|
||||
if (string.IsNullOrEmpty(downloadFolder)) {
|
||||
@@ -271,7 +271,7 @@ namespace FarmmapsKPI
|
||||
dataList = new List<string> { };
|
||||
kpio = JsonConvert.DeserializeObject<KPIOutput>(item.Data.ToString());
|
||||
//Seems sometimes duplicate KPI items are returned. So check that here and only write if this kpio is different from previous
|
||||
if (kpio != kpioPrevious)
|
||||
if (kpio.id != kpioPrevious.id)
|
||||
{
|
||||
dataList.Add(kpio.parentName);
|
||||
dataList.Add(kpio.data.area);
|
||||
|
||||
Reference in New Issue
Block a user