finalized api answer data structure from api documentation

fixed UpdateMedia method to use correct fields from poi
This commit is contained in:
2018-08-24 17:30:57 +02:00
parent fe5f4e6138
commit 48b57ecb80
2 changed files with 5 additions and 10 deletions

View File

@@ -110,6 +110,9 @@ namespace RothenburgAR.Updater
[JsonProperty("imageId")] [JsonProperty("imageId")]
public string ImageId { get; set; } public string ImageId { get; set; }
[JsonProperty("mediaId")]
public string MediaId { get; set; }
[JsonProperty("x")] [JsonProperty("x")]
public double X { get; set; } public double X { get; set; }

View File

@@ -94,8 +94,7 @@ namespace RothenburgAR.Updater
} }
}); });
result = result.Substring(0, result.Length - 1); result = result.Substring(0, result.Length - 1) + "}";
result += "}";
return result; return result;
} }
@@ -178,16 +177,9 @@ namespace RothenburgAR.Updater
private void UpdateMedia(Exhibit exhibit) private void UpdateMedia(Exhibit exhibit)
{ {
//TODO implement feedback: which id is the right one?
// ImageId is apparently just the ExhibitId
// Exhibit doesn't have media, POI does. so the Exhibit.MediaId doesn't make sense
//exhibit.MediaId;
//exhibit.Pois[0].ImageId;
//TODO check existing file for creation/alteration date to see if download is necessary //TODO check existing file for creation/alteration date to see if download is necessary
var mediaIDs = new List<string> { exhibit.MediaId }; var mediaIDs = exhibit.Pois.Select(p => p.MediaId).ToList();
//var mediaIDs = exhibit.Pois.Select(p => p.ImageId).ToList();
foreach (var mediaId in mediaIDs) foreach (var mediaId in mediaIDs)
{ {