don't burn serials on bad links/pages

This commit is contained in:
Alexis Marie Wright 2022-04-16 21:41:14 -04:00
parent 6844d40467
commit e41e395f12
1 changed files with 6 additions and 3 deletions

View File

@ -41,8 +41,6 @@ function fetchSiteContent($knownContent = array()) {
$link = new ComicPage;
$link->serial = $nextSerial++;
$link->href = $pageUrl;
$link->pageNo = $el->innerText;
@ -87,11 +85,16 @@ function fetchSiteContent($knownContent = array()) {
throw new Exception("Failed to find an image in {$el} ({$el->href})");
};
// we wait to set the serial (and increment nextSerial)
// until we know we're going to add this item to the
// content list
$link->serial = $nextSerial++;
$link->imageUrl = Config::baseUrl . '/' . $link->imageUrl;
array_push($comicPages, $link);
Log::info("Fetched " . $link->href);
Log::debug($link);
Log::silly($link);
usleep(250000); // don't be too rude
};