diff options
author | John Ankarström <john@ankarstrom.se> | 2022-09-02 23:51:40 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-09-02 23:51:40 +0200 |
commit | 00447478cd1d0d64752114df49fee5ee8bdcedbe (patch) | |
tree | ca1168b19ab977c1857d3a3e341a3e80b33cc6d3 /c/data.cpp | |
parent | ff9ba3f6e60fa30f52dd94e48214be5e1be1b28a (diff) | |
download | EpisodeBrowser-00447478cd1d0d64752114df49fee5ee8bdcedbe.tar.gz |
Add Act.
Diffstat (limited to 'c/data.cpp')
-rw-r--r-- | c/data.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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<htmlParserCtxtPtr, xmlFreeParserCtxt> ctx = RemoteParserCtxt(url, nullptr); xpathCtx = xmlXPathNewContext(ctx.v->myDoc); if (xpathCtx.Bad(0)) |