From 00447478cd1d0d64752114df49fee5ee8bdcedbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 2 Sep 2022 23:51:40 +0200 Subject: Add Act. --- c/data.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'c/data.cpp') diff --git a/c/data.cpp b/c/data.cpp index b1c028e..62d544a 100644 --- a/c/data.cpp +++ b/c/data.cpp @@ -125,7 +125,7 @@ void WaitFor(Window& window, void (*f)(unsigned char*)) sig |= DONE; } catch (...) { sig |= DONE; - ShowException(L"Remote data could not be fetched due to an error: %s", + ShowException(L"Remote data could not be fetched due to an error while %s: %s", L"Error", MB_ICONWARNING); } }; @@ -155,6 +155,8 @@ void WaitFor(Window& window, void (*f)(unsigned char*)) void FetchData(unsigned char* sig) { + Act(L"fetching and parsing general episode data"); + /* The remote data is retrieved using WinINet from the * Detective Conan World wiki. Using libxml2's "push parser", * the HTML is parsed piece by piece as it is retrieved. The @@ -181,6 +183,8 @@ void FetchData(unsigned char* sig) if (!nodes || !nodes->nodeNr) throw std::runtime_error("could not find remote episode information"); + Act(L"inserting remote data"); + for (int i = 0; i < nodes->nodeNr; i++) { if (*sig & ABORT) return; @@ -222,6 +226,8 @@ void FetchData(unsigned char* sig) void FetchScreenwriters(unsigned char* sig) { + Act(L"fetching and parsing screenwriter data"); + /* Screenwriters are expensive to fetch, so we try to avoid * fetching screenwriters for episodes that already have a * screenwriter. Additionally, in the same session, we don't @@ -262,7 +268,6 @@ void FetchScreenwriters(unsigned char* sig) Wcscpy(Buf(url)+Len(prefix), d.wiki); /* Retrieve screenwriter from HTML. */ - UniqueOk ctx = RemoteParserCtxt(url, nullptr); xpathCtx = xmlXPathNewContext(ctx.v->myDoc); if (xpathCtx.Bad(0)) -- cgit v1.2.3