Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian 285a65f018 1.205.16 2022-01-30 22:15:09 +01:00
DebaucheryLibrarian 815d56d334 Preventing media associations when use-reference is unavailable. 2022-01-30 22:15:07 +01:00
4 changed files with 15 additions and 12 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.205.15", "version": "1.205.16",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "traxxx", "name": "traxxx",
"version": "1.205.15", "version": "1.205.16",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@casl/ability": "^5.2.2", "@casl/ability": "^5.2.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "traxxx", "name": "traxxx",
"version": "1.205.15", "version": "1.205.16",
"description": "All the latest porn releases in one place", "description": "All the latest porn releases in one place",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {

View File

@ -828,7 +828,7 @@ async function associateReleaseMedia(releases, type = 'release') {
const media = storedMediasById[baseMedia.id]; const media = storedMediasById[baseMedia.id];
const mediaId = media?.use || media?.entry?.id; const mediaId = media?.use || media?.entry?.id;
if (mediaId) { if (mediaId && storedMediasById[mediaId]) {
acc.push({ acc.push({
[`${type}_id`]: releaseId, [`${type}_id`]: releaseId,
media_id: mediaId, media_id: mediaId,
@ -840,15 +840,9 @@ async function associateReleaseMedia(releases, type = 'release') {
}, []) }, [])
.filter(Boolean); .filter(Boolean);
try {
if (associations.length > 0) { if (associations.length > 0) {
await bulkInsert(`${type}s_${role}`, associations, false); 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;
}
} catch (error) { } catch (error) {
if (error.entries) { if (error.entries) {
logger.error(util.inspect(error.entries, null, null, { color: true })); logger.error(util.inspect(error.entries, null, null, { color: true }));

View File

@ -437,6 +437,15 @@ async function scrapeSceneApi(data, site, options) {
`https://images-evilangel.gammacdn.com/movies${data.pictures.resized}`, `https://images-evilangel.gammacdn.com/movies${data.pictures.resized}`,
`https://transform.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`,
] : []),
]; ];
} }