private static async Task SyncEntries(CatalogItem local, CatalogItem remote) { if (LocalScraper.Compare(local, remote) != 0) { LocalScraper.SaveImagesToLocal(remote); LocalScraper.SetLocalImages(remote); await LocalScraper.SaveAsync(remote); } }
protected override async Task <string> ProcessPostRequest(HttpListenerRequest request, EmptyApiParameters parameters, string postData) { var item = FromJson <CatalogItem>(postData); if (item == null) { return(ToJson(new { status = "error" })); } await LocalScraper.SaveAsync(item); UpdateCacheEntries(item); return(ToJson(new { status = "ok" })); }