Optionalized qualities.

This commit is contained in:
DebaucheryLibrarian 2022-03-31 14:34:10 +02:00
parent 122dd3eaee
commit a19a77e165
2 changed files with 8 additions and 5 deletions

View File

@ -43,6 +43,8 @@ function scrapeLatest(scenes, site) {
cover, cover,
]]; ]];
console.log(release);
return release; return release;
}); });
} }
@ -53,7 +55,7 @@ function scrapeLatestAlt(scenes, site) {
release.url = query.url('figure a', 'href', { origin: site.parameters.latest }); release.url = query.url('figure a', 'href', { origin: site.parameters.latest });
release.title = query.cnt('.has-text-weight-bold'); release.title = query.cnt('.has-text-weight-bold, .is-size-6');
release.date = query.date('span.tag', 'YYYY-MM-DD'); release.date = query.date('span.tag', 'YYYY-MM-DD');
release.actors = query.cnts('a.tag'); release.actors = query.cnts('a.tag');
@ -62,7 +64,8 @@ function scrapeLatestAlt(scenes, site) {
release.poster = cover.replace('poster_noplay', 'trailer_noplay'); release.poster = cover.replace('poster_noplay', 'trailer_noplay');
release.covers = [cover]; release.covers = [cover];
release.entryId = `${qu.formatDate(release.date, 'YYYY-MM-DD')}-${slugify(release.title)}`; release.entryId = `${qu.formatDate(release.date, 'YYYY-MM-DD')}-${slugify(release.title.split(/\s+/).slice(0, 5).join(' '))}`;
console.log('alt', release);
return release; return release;
}); });
@ -94,6 +97,8 @@ function scrapeScene({ query }, site) {
const trailer = query.trailer(); const trailer = query.trailer();
if (trailer) release.trailer = { src: trailer }; if (trailer) release.trailer = { src: trailer };
console.log(release);
return release; return release;
} }

View File

@ -38,7 +38,7 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
date_precision: release.datePrecision, date_precision: release.datePrecision,
slug, slug,
description: release.description, description: release.description,
qualities: release.qualities.map(Number).filter(Boolean), qualities: release.qualities?.map(Number).filter(Boolean),
comment: release.comment, comment: release.comment,
deep: typeof release.deep === 'boolean' ? release.deep : false, deep: typeof release.deep === 'boolean' ? release.deep : false,
deep_url: release.deepUrl, deep_url: release.deepUrl,
@ -69,8 +69,6 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce
curatedRelease.created_batch_id = batchId; curatedRelease.created_batch_id = batchId;
} }
console.log(curatedRelease);
return curatedRelease; return curatedRelease;
} }