From a19a77e165abd83fbeb65633ec6dab2e185d8ba6 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 31 Mar 2022 14:34:10 +0200 Subject: [PATCH] Optionalized qualities. --- src/scrapers/insex.js | 9 +++++++-- src/store-releases.js | 4 +--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/scrapers/insex.js b/src/scrapers/insex.js index f912172f..0b0affab 100644 --- a/src/scrapers/insex.js +++ b/src/scrapers/insex.js @@ -43,6 +43,8 @@ function scrapeLatest(scenes, site) { cover, ]]; + console.log(release); + return release; }); } @@ -53,7 +55,7 @@ function scrapeLatestAlt(scenes, site) { 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.actors = query.cnts('a.tag'); @@ -62,7 +64,8 @@ function scrapeLatestAlt(scenes, site) { release.poster = cover.replace('poster_noplay', 'trailer_noplay'); 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; }); @@ -94,6 +97,8 @@ function scrapeScene({ query }, site) { const trailer = query.trailer(); if (trailer) release.trailer = { src: trailer }; + console.log(release); + return release; } diff --git a/src/store-releases.js b/src/store-releases.js index 82a80974..b285ec5e 100644 --- a/src/store-releases.js +++ b/src/store-releases.js @@ -38,7 +38,7 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce date_precision: release.datePrecision, slug, description: release.description, - qualities: release.qualities.map(Number).filter(Boolean), + qualities: release.qualities?.map(Number).filter(Boolean), comment: release.comment, deep: typeof release.deep === 'boolean' ? release.deep : false, deep_url: release.deepUrl, @@ -69,8 +69,6 @@ async function curateReleaseEntry(release, batchId, existingRelease, type = 'sce curatedRelease.created_batch_id = batchId; } - console.log(curatedRelease); - return curatedRelease; }