|
|
|
|
@ -266,9 +266,8 @@ |
|
|
|
|
const pageCount = data.pageCount(); |
|
|
|
|
const elapsed = Date.now() - startTime; |
|
|
|
|
|
|
|
|
|
// Skip tournaments with no pages (this shouldn't happen now, but just in case) |
|
|
|
|
if (pageCount === 0) { |
|
|
|
|
console.log('Tournament has no content, should have been filtered out'); |
|
|
|
|
console.log('No pages to display yet'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -290,12 +289,10 @@ |
|
|
|
|
reason = 'Single page - 15 seconds elapsed'; |
|
|
|
|
} |
|
|
|
|
} else if (pageCount > 1) { |
|
|
|
|
// Multi-page tournament: complete when we're about to go back to page 1 after seeing all pages |
|
|
|
|
// Check if we're at the last page and have seen all pages |
|
|
|
|
if (currentActive === pageCount && maxPagesSeen >= pageCount && lastActive !== null) { |
|
|
|
|
// We're at the last page and have seen all pages - complete now before going back to page 1 |
|
|
|
|
// Multi-page tournament: complete when we cycle back to page 1 after seeing all pages |
|
|
|
|
if (currentActive === 1 && lastActive > 1 && maxPagesSeen >= pageCount) { |
|
|
|
|
shouldComplete = true; |
|
|
|
|
reason = 'Multi-page - completed at last page (avoiding first page repeat)'; |
|
|
|
|
reason = 'Multi-page - full cycle completed'; |
|
|
|
|
} else if (elapsed >= completionTime) { |
|
|
|
|
// Fallback: complete after (pageCount * 15 seconds) |
|
|
|
|
shouldComplete = true; |
|
|
|
|
|