Appending date to Jules Jordan title-derived entry ID.

This commit is contained in:
DebaucheryLibrarian 2024-08-27 02:16:25 +02:00
parent 035312bd9c
commit 73676b8628
1 changed files with 15 additions and 3 deletions

View File

@ -25,6 +25,10 @@ function getEntryId(html) {
return null; return null;
} }
function getEntryIdFromTitle(release) {
return slugify([release.title, release.date && unprint.formatDate(release.date, 'YYYY-MM-DD')]);
}
function scrapeAll(scenes, site, entryIdFromTitle) { function scrapeAll(scenes, site, entryIdFromTitle) {
return scenes.map(({ element, query }) => { return scenes.map(({ element, query }) => {
const release = {}; const release = {};
@ -34,7 +38,10 @@ function scrapeAll(scenes, site, entryIdFromTitle) {
release.url = query.url('.content_img a, .dvd_info > a, a.update_title, a[title]'); release.url = query.url('.content_img a, .dvd_info > a, a.update_title, a[title]');
release.date = query.date('.update_date', ['MM/DD/YYYY', 'YYYY-MM-DD']); release.date = query.date('.update_date', ['MM/DD/YYYY', 'YYYY-MM-DD']);
release.entryId = (entryIdFromTitle && slugify(release.title)) || element.dataset.setid || query.element('.rating_box')?.dataset.id || query.attribute('a img', 'id')?.match(/set-target-(\d+)/)?.[1]; release.entryId = (entryIdFromTitle && getEntryIdFromTitle(release))
|| element.dataset.setid
|| query.element('.rating_box')?.dataset.id
|| query.attribute('a img', 'id')?.match(/set-target-(\d+)/)?.[1];
release.actors = query.all('.content_img .update_models a, .update_models a').map((actorEl) => ({ release.actors = query.all('.content_img .update_models a, .update_models a').map((actorEl) => ({
name: unprint.query.content(actorEl), name: unprint.query.content(actorEl),
@ -91,7 +98,9 @@ function scrapeUpcoming(scenes, channel) {
release.poster = query.img('img') || query.img('img', { attribute: 'src0_1x' }); release.poster = query.img('img') || query.img('img', { attribute: 'src0_1x' });
release.teaser = html.match(/src=['"](https:\/\/.*\.mp4)['"]/)?.[1]; release.teaser = html.match(/src=['"](https:\/\/.*\.mp4)['"]/)?.[1];
release.entryId = channel.parameters?.entryIdFromTitle ? slugify(release.title) : getEntryId(html); release.entryId = channel.parameters?.entryIdFromTitle
? getEntryIdFromTitle(release)
: getEntryId(html);
return release; return release;
}); });
@ -157,10 +166,13 @@ async function scrapeScene({ html, query }, context) {
release.title = query.content('.title_bar_hilite, .movie_title'); release.title = query.content('.title_bar_hilite, .movie_title');
release.description = query.content('.update_description') || query.text('//div[./span[contains(text(), "Description")]]'); release.description = query.content('.update_description') || query.text('//div[./span[contains(text(), "Description")]]');
release.entryId = context.entity.parameters?.entryIdFromTitle ? slugify(release.title) : getEntryId(html);
release.date = query.date(['.update_date', '//div[./span[contains(text(), "Date")]]'], ['MM/DD/YYYY', 'YYYY-MM-DD']); release.date = query.date(['.update_date', '//div[./span[contains(text(), "Date")]]'], ['MM/DD/YYYY', 'YYYY-MM-DD']);
release.entryId = context.entity.parameters?.entryIdFromTitle
? getEntryIdFromTitle(release)
: getEntryId(html);
release.actors = query.all('.backgroundcolor_info > .update_models a, .item .update_models a, .player-scene-description .update_models a').map((actorEl) => ({ release.actors = query.all('.backgroundcolor_info > .update_models a, .item .update_models a, .player-scene-description .update_models a').map((actorEl) => ({
name: unprint.query.content(actorEl), name: unprint.query.content(actorEl),
url: unprint.query.url(actorEl, null), url: unprint.query.url(actorEl, null),