Writing media associations to disk for debugging.

This commit is contained in:
DebaucheryLibrarian 2022-01-30 17:05:18 +01:00
parent 7cf47cbf8d
commit 22864105ac
2 changed files with 2 additions and 1 deletions

View File

@ -846,6 +846,7 @@ async function associateReleaseMedia(releases, type = 'release') {
}
} catch (error) {
console.log(associations);
await fs.promises.writeFile(`./associations-${Date.now()}`, JSON.stringify(associations, null, 4));
throw error;
}
} catch (error) {

View File

@ -489,7 +489,7 @@ async function scrapeMovie({ query, el }, url, entity, baseRelease, options) {
const { dataLayer } = query.exec('//script[contains(text(), "dataLayer")]', ['dataLayer']);
const rawData = dataLayer?.[0]?.dvdDetails;
const data = rawData.dvdId && rawData; // dvdDetails is mostly empty in some cache states
const data = rawData?.dvdId && rawData; // dvdDetails is mostly empty in some cache states
release.entryId = new URL(url).pathname.match(/\/(\d+)(\/|$)/)?.[1];