diff --git a/src/media.js b/src/media.js index 035d55d9..eeca2b23 100644 --- a/src/media.js +++ b/src/media.js @@ -828,7 +828,7 @@ async function associateReleaseMedia(releases, type = 'release') { const media = storedMediasById[baseMedia.id]; const mediaId = media?.use || media?.entry?.id; - if (mediaId) { + if (mediaId && storedMediasById[mediaId]) { acc.push({ [`${type}_id`]: releaseId, media_id: mediaId, @@ -840,14 +840,8 @@ async function associateReleaseMedia(releases, type = 'release') { }, []) .filter(Boolean); - try { - if (associations.length > 0) { - await bulkInsert(`${type}s_${role}`, associations, false); - } - } catch (error) { - console.log(associations); - await fs.promises.writeFile(`./associations-${Date.now()}`, JSON.stringify(associations, null, 4)); - throw error; + if (associations.length > 0) { + await bulkInsert(`${type}s_${role}`, associations, false); } } catch (error) { if (error.entries) { diff --git a/src/scrapers/gamma.js b/src/scrapers/gamma.js index 53855647..05545d2f 100644 --- a/src/scrapers/gamma.js +++ b/src/scrapers/gamma.js @@ -437,6 +437,15 @@ async function scrapeSceneApi(data, site, options) { `https://images-evilangel.gammacdn.com/movies${data.pictures.resized}`, `https://transform.gammacdn.com/movies${data.pictures.resized}`, ] : []), + ...(data.pictures['960x544'] ? [ + `https://images-fame.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + `https://images01-fame.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + `https://images02-fame.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + `https://images03-fame.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + `https://images04-fame.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + `https://images-evilangel.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + `https://transform.gammacdn.com/movies${data.pictures['960x544']}?width=1950`, + ] : []), ]; }