Preventing Bang! scraper from redundant deep scraping when base release is available.
This commit is contained in:
@@ -102,6 +102,8 @@ async function scrapeScene(scene, entity, options) {
|
||||
.replace(/[! .]/g, '')
|
||||
.replace('&', 'and');
|
||||
|
||||
console.log(release);
|
||||
|
||||
return release;
|
||||
}
|
||||
|
||||
@@ -357,6 +359,11 @@ async function fetchUpcoming(site, page = 1) {
|
||||
}
|
||||
|
||||
async function fetchScene(url, entity, baseRelease, options) {
|
||||
if (baseRelease?.entryId) {
|
||||
// overview and deep data is the same, don't hit server unnecessarily
|
||||
return baseRelease;
|
||||
}
|
||||
|
||||
const encodedId = new URL(url).pathname.split('/')[2];
|
||||
const entryId = decodeId(encodedId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user