Passing recursive parameters to all scraper methods. Using throttle parameters in MindGeek scraper, fixed missing slug breaking scene and actor URLs.
This commit is contained in:
11
src/utils/get-recursive-parameters.js
Normal file
11
src/utils/get-recursive-parameters.js
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
function getRecursiveParameters(entity, parameters) {
|
||||
if (entity.parent) {
|
||||
return getRecursiveParameters(entity.parent, { ...parameters, ...entity.parameters });
|
||||
}
|
||||
|
||||
return { ...parameters, ...entity.parameters };
|
||||
}
|
||||
|
||||
module.exports = getRecursiveParameters;
|
||||
Reference in New Issue
Block a user