don't burn serials on bad links/pages
This commit is contained in:
parent
6844d40467
commit
e41e395f12
|
@ -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
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue