Added actor photos to Brazzers scene scrape. Added no-video poster to Score. Not flattening actor avatar fallbacks.

This commit is contained in:
2020-03-04 17:21:40 +01:00
parent 6733777f63
commit 6c3cba1b87
5 changed files with 31 additions and 15 deletions

View File

@@ -93,7 +93,7 @@ async function extractItem(source) {
return null;
}
async function fetchItem(source, index, existingItemsBySource, domain, role, attempt = 1, originalSource = null) {
async function fetchItem(source, index, existingItemsBySource, domain, role, attempt = 1, originalSource = null, sourceIndex = 0) {
if (!source) return null;
try {
@@ -106,7 +106,7 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
// fallbacks provided
return source.reduce(
(outcome, sourceX) => outcome.catch(async () => fetchItem(sourceX, index, existingItemsBySource, domain, role, attempt, originalSource)),
(outcome, sourceX, sourceIndexX) => outcome.catch(async () => fetchItem(sourceX, index, existingItemsBySource, domain, role, attempt, originalSource, sourceIndexX)),
Promise.reject(new Error()),
);
}
@@ -164,7 +164,11 @@ async function fetchItem(source, index, existingItemsBySource, domain, role, att
if (attempt < 3) {
await Promise.delay(5000);
return fetchItem(source, index, existingItemsBySource, domain, role, attempt + 1);
return fetchItem(source, index, existingItemsBySource, domain, role, attempt + 1, originalSource);
}
if (originalSource && sourceIndex < originalSource.length) {
throw error;
}
return null;