Added movie tile. Fixed actor header. Larger breakpoint for nav menu.

This commit is contained in:
DebaucheryLibrarian 2020-08-01 15:11:07 +02:00
parent 6c5a62353c
commit 767437d9aa
28 changed files with 254 additions and 67 deletions

View File

@ -29,7 +29,7 @@
/>
</div>
<div class="actor-inner">
<div class="content-inner actor-inner">
<div
class="profile"
:class="{ expanded: bioExpanded, 'with-avatar': !!actor.avatar }"
@ -714,8 +714,13 @@ export default {
margin: 1rem 0 0 0;
}
.actor-header {
padding: .5rem 1rem;
}
.header-name {
flex-grow: 1;
font-size: 1.3rem;
}
}
</style>

View File

@ -356,7 +356,7 @@ export default {
}
}
@media(max-width: $breakpoint-micro) {
@media(max-width: $breakpoint) {
.nav {
display: none;
}

View File

@ -1,11 +1,48 @@
<template>
<div class="movies">
<h1 class="heading">Movies</h1>
<div class="tiles">
<Movie
v-for="movie in movies"
:key="`movie-${movie.id}`"
:movie="movie"
/>
</div>
</div>
</template>
<script>
import Movie from './tile.vue';
async function mounted() {
const { movies, totalCount } = await this.$store.dispatch('fetchMovies', {
limit: 30,
});
this.movies = movies;
this.totalCount = totalCount;
}
export default {
components: {
Movie,
},
data() {
return {
movies: [],
totalCount: 0,
};
},
mounted,
};
</script>
<style lang="scss">
.movies {
padding: 1rem;
}
.tiles {
display: grid;
grid-template-columns: repeat(auto-fill, 12rem);
}
</style>

View File

@ -0,0 +1,38 @@
<template>
<div class="tile">
<div class="details">{{ movie.entity.name }}</div>
<h3 class="title">{{ movie.title }}</h3>
</div>
</template>
<script>
export default {
props: {
movie: {
type: Object,
default: null,
},
},
};
</script>
<style lang="scss" scoped>
.tile {
background: var(--background);
box-shadow: 0 0 3px var(--darken);
}
.details {
color: var(--text-light);
background: var(--profile);
padding: .5rem 1rem;
font-size: .8rem;
font-weight: bold;
}
.title {
padding: 1rem;
margin: 0;
font-size: 1rem;
}
</style>

View File

@ -48,13 +48,11 @@ async function mounted() {
'creampie',
'squirting',
],
ethnicity: [
appearance: [
'asian',
'ebony',
'latina',
'caucasian',
],
appearance: [
'natural-boobs',
'fake-boobs',
'blonde',

View File

@ -3,12 +3,6 @@
v-if="tag.poster"
class="tile"
>
<router-link
class="title"
:to="{ name: 'tag', params: { tagSlug: tag.slug, range: 'latest' } }"
:title="tag.name"
>{{ tag.name }}</router-link>
<router-link
:to="{ name: 'tag', params: { tagSlug: tag.slug, range: 'latest' } }"
:title="tag.name"
@ -48,6 +42,13 @@
class="poster"
>
</router-link>
<router-link
class="title"
:to="{ name: 'tag', params: { tagSlug: tag.slug, range: 'latest' } }"
:title="tag.name"
>{{ tag.name }}</router-link>
</div>
<span
@ -85,15 +86,10 @@ export default {
box-sizing: border-box;
position: relative;
text-decoration: none;
font-size: 0;
&:hover {
.title {
color: var(--primary);
}
.poster {
box-shadow: 0 0 3px var(--darken);
}
&:hover .poster {
box-shadow: 0 0 3px var(--darken);
}
}
@ -103,13 +99,15 @@ export default {
}
.title {
display: inline-block;
display: block;
box-sizing: border-box;
padding: .25rem 1rem .25rem .5rem;
padding: .5rem;
overflow: hidden;
white-space: nowrap;
color: var(--shadow-strong);
color: var(--text-light);
background: var(--profile);
text-decoration: none;
font-size: .9rem;
font-weight: bold;
text-transform: capitalize;
text-overflow: ellipsis;

View File

@ -7,8 +7,6 @@
<title>traxxx</title>
<link rel="stylesheet" href="/css/style.css">
<link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon/favicon-16x16.png">
@ -18,6 +16,8 @@
<meta name="msapplication-TileColor" content="#aa2c66">
<meta name="msapplication-config" content="/img/favicon/browserconfig.xml">
<link rel="stylesheet" href="/css/style.css">
<script src="/js/bundle.js" defer></script>
</head>
<body>

View File

@ -180,6 +180,13 @@ function initEntitiesActions(store, _router) {
type: {
equalTo: "network"
}
childEntitiesConnection: {
some: {
type: {
equalTo: "channel"
}
}
}
}
{
independent: {
@ -197,7 +204,7 @@ function initEntitiesActions(store, _router) {
in: $entitySlugs
}
}
]
],
}
) {
id

View File

@ -243,11 +243,6 @@ const releaseFragment = `
${releaseTrailerFragment}
${releaseTeaserFragment}
${siteFragment}
scenes: releasesMoviesByMovieId {
scene {
${releaseFields}
}
}
studio {
id
name

View File

@ -47,9 +47,48 @@ function initReleasesActions(store, _router) {
return curateRelease(release);
}
async function fetchMovies({ _commit }, { limit = 10, pageNumber = 1 }) {
const { connection: { movies, totalCount } } = await graphql(`
query Movies(
$limit:Int = 1000,
$offset:Int = 0,
) {
connection: moviesConnection(
first: $limit
offset: $offset
orderBy: DATE_ASC
) {
movies: nodes {
id
title
url
slug
date
datePrecision
entity {
id
name
slug
}
}
totalCount
}
}
`, {
limit,
offset: Math.max(0, (pageNumber - 1)) * limit,
});
return {
movies: movies.map(release => curateRelease(release)),
totalCount,
};
}
return {
fetchReleases,
fetchReleaseById,
fetchMovies,
};
}

View File

@ -643,6 +643,32 @@ exports.up = knex => Promise.resolve()
table.datetime('created_at')
.defaultTo(knex.fn.now());
}))
.then(() => knex.schema.createTable('movies_covers', (table) => {
table.integer('movie_id', 16)
.notNullable()
.references('id')
.inTable('movies');
table.text('media_id', 21)
.notNullable()
.references('id')
.inTable('media');
table.unique(['movie_id', 'media_id']);
}))
.then(() => knex.schema.createTable('movies_trailers', (table) => {
table.integer('movie_id', 16)
.notNullable()
.references('id')
.inTable('movies');
table.text('media_id', 21)
.notNullable()
.references('id')
.inTable('media');
table.unique('movie_id');
}))
.then(() => knex.schema.createTable('releases', (table) => {
table.increments('id', 16);
@ -965,6 +991,9 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
DROP TABLE IF EXISTS releases_tags CASCADE;
DROP TABLE IF EXISTS releases_search CASCADE;
DROP TABLE IF EXISTS movies_covers CASCADE;
DROP TABLE IF EXISTS movies_trailers CASCADE;
DROP TABLE IF EXISTS batches CASCADE;
DROP TABLE IF EXISTS actors_avatars CASCADE;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 KiB

After

Width:  |  Height:  |  Size: 348 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 992 KiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -7920,7 +7920,7 @@ const sites = [
{
name: 'PornDoe Pedia',
slug: 'porndoepedia',
url: 'https://vipsexvault.com/channels/vipsexvault-pedia.en.html',
url: 'https://vipsexvault.com/channels/porndoe-pedia.en.html',
parent: 'vipsexvault',
},
{

View File

@ -615,7 +615,7 @@ const tagPosters = [
['dvp', 'poster', 'Riley Reid in "Pizza That Ass" for Reid My Lips'],
['dv-tp', 'poster', 'Juelz Ventura in "Gangbanged 5" for Elegant Angel'],
['ebony', 2, 'Nia Nacci for Sweetheart Video'],
['facefucking', 2, 'Jynx Maze for Throated'],
['facefucking', 1, 'Paige Owens in "Dark Meat 12" for Evil Angel'],
['facial', 0, 'Brooklyn Gray in "All About Ass 4" for Evil Angel'],
['fake-boobs', 2, 'Gia Milana in "Hot Anal Latina" for HardX'],
['family', 0, 'Teanna Trump in "A Family Appear: Part One" for Brazzers'],
@ -703,8 +703,8 @@ const tagPhotos = [
['ebony', 1, 'Ana Foxxx in "DP Me 4" for HardX'],
['facial', 2, 'Ashly Anderson for Hookup Hotshot'],
['facial', 'poster', 'Jynx Maze'],
['facefucking', 2, 'Jynx Maze for Throated'],
['facefucking', 3, 'Adriana Chechik in "Performing Magic Butt Tricks With Jules Jordan. What Will Disappear In Her Ass?" for Jules Jordan'],
['facefucking', 1, 'Carrie for Young Throats'],
['fake-boobs', 7, 'Madison Ivy for Passion HD'],
['fake-boobs', 1, 'Lela Star in "Thick" for Jules Jordan'],
['fake-boobs', 6, 'Cathy Heaven in "Heavenly Ass" for Big Wett Butts'],

View File

@ -8,7 +8,7 @@ const initServer = require('./web/server');
const knex = require('./knex');
const fetchUpdates = require('./updates');
const { fetchScenes, fetchMovies } = require('./deep');
const { storeReleases, updateReleasesSearch } = require('./store-releases');
const { storeReleases, storeMovies, updateReleasesSearch } = require('./store-releases');
const { scrapeActors } = require('./actors');
const getFileEntries = require('./utils/file-entries');
@ -31,14 +31,14 @@ async function init() {
const updateBaseScenes = (argv.all || argv.channels || argv.networks || argv.movies) && await fetchUpdates();
const scenesFromFile = argv.scenesFile && await getFileEntries(argv.scenesFile);
const sceneUrls = (argv.scenes || []).concat(scenesFromFile || []);
const sceneUrls = (argv.scene || []).concat(scenesFromFile || []);
const deepScenes = argv.deep
? await fetchScenes([...(sceneUrls), ...(updateBaseScenes || []), ...(actorBaseScenes || [])])
: [...(updateBaseScenes || []), ...(actorBaseScenes || [])];
const sceneMovies = deepScenes && argv.sceneMovies && deepScenes.map(scene => scene.movie).filter(Boolean);
const deepMovies = await fetchMovies([...(argv.movies || []), ...(sceneMovies || [])]);
const sceneMovies = deepScenes && argv.movie && deepScenes.map(scene => scene.movie).filter(Boolean);
const deepMovies = await fetchMovies([...(argv.movie || []), ...(sceneMovies || [])]);
if (argv.inspect) {
console.log(util.inspect(deepScenes));
@ -46,10 +46,15 @@ async function init() {
}
if (argv.save) {
await storeReleases([
...(deepScenes || []),
...(deepMovies || []),
]);
if (deepScenes.length > 0) {
await storeReleases(deepScenes);
}
console.log(deepMovies);
if (deepMovies.length > 0) {
await storeMovies(deepMovies);
}
}
knex.destroy();

View File

@ -25,10 +25,6 @@ const { argv } = yargs
type: 'array',
alias: 'channel',
})
.option('movies', {
describe: 'Scrape movies from channels',
type: 'array',
})
.option('actors', {
describe: 'Scrape actors by name or slug',
type: 'array',
@ -61,19 +57,18 @@ const { argv } = yargs
alias: 'with-profiles',
default: false,
})
.option('scenes', {
.option('scene', {
describe: 'Scrape scene info from URL',
type: 'array',
alias: 'scene',
})
.option('scenes-file', {
.option('scene-file', {
describe: 'Scrape scene info from URLs in a file',
type: 'string',
alias: 'scenes-file',
})
.option('movie', {
describe: 'Scrape movie info from URL',
type: 'array',
alias: 'movies',
})
.option('sources', {
describe: 'Use these scrapers for actor data',
@ -88,12 +83,17 @@ const { argv } = yargs
.option('latest', {
describe: 'Scrape latest releases if available',
type: 'boolean',
default: true,
default: false,
})
.option('upcoming', {
describe: 'Scrape upcoming releases if available',
type: 'boolean',
default: true,
default: false,
})
.option('movies', {
describe: 'Scrape movies from channels',
type: 'boolean',
default: false,
})
.option('force', {
describe: 'Don\'t ignore duplicates, update existing entries',

View File

@ -612,7 +612,7 @@ async function storeMedias(baseMedias) {
return [...newMediaWithEntries, ...existingHashMedias];
}
async function associateReleaseMedia(releases) {
async function associateReleaseMedia(releases, type = 'releases') {
if (!argv.media) {
return;
}
@ -670,7 +670,7 @@ async function associateReleaseMedia(releases) {
.filter(Boolean);
if (associations.length > 0) {
await knex.raw(`${knex(`releases_${role}`).insert(associations)} ON CONFLICT DO NOTHING`);
await knex.raw(`${knex(`${type}_${role}`).insert(associations)} ON CONFLICT DO NOTHING`);
}
}, Promise.resolve());
}

View File

@ -276,13 +276,13 @@ async function scrapeScene({ html, qu }, url, site, include) {
return release;
}
function scrapeMovie({ el, qu }, url, site) {
function scrapeMovie({ el, query }, url, site) {
const movie = { url, site };
movie.entryId = qu.q('.dvd_details_overview .rating_box').dataset.id;
movie.title = qu.q('.title_bar span', true);
movie.covers = qu.urls('#dvd-cover-flip > a');
movie.channel = slugify(qu.q('.update_date a', true), '');
movie.entryId = query.q('.rating_box').dataset.id;
movie.title = query.q('.title_bar span', true);
movie.covers = query.urls('#dvd-cover-flip > a');
movie.channel = slugify(query.q('.update_date a', true), '');
// movie.releases = Array.from(document.querySelectorAll('.cell.dvd_info > a'), el => el.href);
const sceneQus = ctxa(el, '.dvd_details');

View File

@ -12,7 +12,7 @@ const { associateReleaseTags } = require('./tags');
const { curateEntity } = require('./entities');
const { associateReleaseMedia } = require('./media');
function curateReleaseEntry(release, batchId, existingRelease) {
function curateReleaseEntry(release, batchId, existingRelease, type = 'scene') {
const slugBase = release.title
|| (release.actors?.length && `${release.entity.slug} ${release.actors.map(actor => actor.name).join(' ')}`)
|| (release.date && `${release.entity.slug} ${formatDate(release.date, 'YYYY MM DD')}`)
@ -23,19 +23,18 @@ function curateReleaseEntry(release, batchId, existingRelease) {
limit: config.titleSlugLength,
});
console.log(release);
const curatedRelease = {
title: release.title,
entry_id: release.entryId || null,
entity_id: release.entity.id,
studio_id: release.studio?.id || null,
shoot_id: release.shootId || null,
url: release.url,
date: Number(release.date) ? release.date : null,
production_date: Number(release.productionDate) ? release.productionDate : null,
date_precision: release.datePrecision,
slug,
description: release.description,
duration: release.duration,
comment: release.comment,
// director: release.director,
// likes: release.rating && release.rating.likes,
@ -46,6 +45,12 @@ function curateReleaseEntry(release, batchId, existingRelease) {
updated_batch_id: batchId,
};
if (type === 'scene') {
curatedRelease.shoot_id = release.shootId || null;
curatedRelease.productionDate = Number(release.productionDate) ? release.productionDate : null;
curatedRelease.duration = release.duration;
}
if (!existingRelease && !release.id) {
curatedRelease.created_batch_id = batchId;
}
@ -252,7 +257,24 @@ async function storeReleases(releases) {
return releasesWithId;
}
async function storeMovies(movies) {
const [batchId] = await knex('batches').insert({ comment: null }).returning('id');
console.log(movies);
const curatedMovieEntries = movies.map(release => curateReleaseEntry(release, batchId, null, 'movie'));
console.log(curatedMovieEntries);
const storedMovies = await knex.batchInsert('movies', curatedMovieEntries).returning('*');
const moviesWithId = attachReleaseIds(movies, storedMovies);
await associateReleaseMedia(moviesWithId, 'movies');
return storedMovies;
}
module.exports = {
storeReleases,
storeMovies,
updateReleasesSearch,
};

View File

@ -161,6 +161,21 @@ async function scrapeUpcomingReleases(scraper, entity, preData) {
return [];
}
async function scrapeMovies(scraper, entity) {
if (!scraper.fetchMovies) {
return [];
}
try {
// return await scrapeReleases(scraper, entity, preData, true);
return await scraper.fetchMovies(entity);
} catch (error) {
logger.warn(`Failed to scrape movies for '${entity.slug}' (${entity.parent?.slug}): ${error.message}`);
}
return [];
}
async function scrapeChannelReleases(scraper, channelEntity, preData) {
const [latestReleases, upcomingReleases] = await Promise.all([
argv.latest
@ -169,12 +184,11 @@ async function scrapeChannelReleases(scraper, channelEntity, preData) {
argv.upcoming
? scrapeUpcomingReleases(scraper, channelEntity, preData)
: [],
argv.movies
? scrapeMovies(scraper, channelEntity, preData)
: [],
]);
if (scraper.fetchMovies) {
await scraper.fetchMovies(channelEntity);
}
logger.info(`Fetching ${latestReleases.length} latest and ${upcomingReleases.length} upcoming updates for '${channelEntity.name}' (${channelEntity.parent?.name})`);
return [...latestReleases, ...upcomingReleases];