예제 #1
0
 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);
     }
 }
예제 #2
0
        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" }));
        }