Added WIP media module. Returning releases from release search database function. Fixed page loop in update module.
This commit is contained in:
@@ -565,6 +565,11 @@ const tags = [
|
||||
name: 'oil',
|
||||
slug: 'oil',
|
||||
},
|
||||
{
|
||||
name: 'nurse',
|
||||
slug: 'nurse',
|
||||
group: 'roleplay',
|
||||
},
|
||||
{
|
||||
name: 'cum in mouth',
|
||||
slug: 'cum-in-mouth',
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const nanoid = require('nanoid/non-secure');
|
||||
const upsert = require('../src/utils/upsert');
|
||||
|
||||
const tagPosters = [
|
||||
@@ -16,6 +17,7 @@ const tagPosters = [
|
||||
['bukkake', 'poster', 'Mia Malkova in "Facialized 2" for HardX'],
|
||||
['caucasian', 0, 'Remy Lacroix for HardX'],
|
||||
['creampie', 'poster', 'ALina Lopez in "Making Yourself Unforgettable" for Blacked'],
|
||||
['cum-in-mouth', 1, 'Keisha Grey in Brazzers House'],
|
||||
['da-tp', 0, 'Natasha Teen in LegalPorno SZ2164'],
|
||||
['deepthroat', 0, 'Chanel Grey in "Deepthroating Is Fun" for Throated'],
|
||||
['double-anal', 7, 'Adriana Chechik in "DP Masters 6" for Jules Jordan'],
|
||||
@@ -35,7 +37,7 @@ const tagPosters = [
|
||||
['milf', 0, 'Olivia Austin in "Dredd 3" for Jules Jordan'],
|
||||
['mff', 0, 'Madison Ivy, Adriana Chechik and Keiran Lee in "Day With A Pornstar" for Brazzers'],
|
||||
['mfm', 5, 'Vina Sky in "Slut Puppies 15" for Jules Jordan'],
|
||||
['cum-in-mouth', 1, 'Keisha Grey in Brazzers House'],
|
||||
['nurse', 0, 'Sarah Vandella in "Cum For Nurse Sarah" for Brazzers'],
|
||||
['orgy', 1, 'Megan Rain (DP), Morgan Lee (anal), Jessa Rhodes, Melissa Moore and Kimmy Granger in "Orgy Masters 8" for Jules Jordan'],
|
||||
['pussy-eating', 0, 'Elena Kosha and Ivy Wolfe in "Bare" for Jules Jordan'],
|
||||
['redhead', 0, 'Penny Pax in "The Submission of Emma Marx: Boundaries" for New Sensations'],
|
||||
@@ -47,6 +49,7 @@ const tagPosters = [
|
||||
['triple-anal', 'poster', 'Kristy Black in SZ1986 for LegalPorno'],
|
||||
]
|
||||
.map(([slug, filename, comment], index) => ({
|
||||
id: nanoid(),
|
||||
tagSlug: slug,
|
||||
path: `tags/${slug}/${filename}.jpeg`,
|
||||
thumbnail: `tags/${slug}/${filename}_thumb.jpeg`,
|
||||
@@ -103,6 +106,7 @@ const tagPhotos = [
|
||||
['cum-in-mouth', 'poster', 'Khloe Kapri'],
|
||||
]
|
||||
.map(([slug, fileIndex, comment], index) => ({
|
||||
id: nanoid(),
|
||||
tagSlug: slug,
|
||||
path: `tags/${slug}/${fileIndex}.jpeg`,
|
||||
thumbnail: `tags/${slug}/${fileIndex}_thumb.jpeg`,
|
||||
@@ -715,6 +719,7 @@ const sfw = Object.entries({
|
||||
],
|
||||
})
|
||||
.map(([category, photos]) => photos.map(([photo, copyright], index) => ({
|
||||
id: nanoid(),
|
||||
path: `sfw/${category}/${photo}.jpeg`,
|
||||
thumbnail: `sfw/${category}/thumbs/${photo}.jpeg`,
|
||||
mime: 'image/jpeg',
|
||||
@@ -730,7 +735,11 @@ const sfw = Object.entries({
|
||||
exports.seed = knex => Promise.resolve()
|
||||
.then(async () => {
|
||||
const { inserted } = await upsert('media', sfw, 'path');
|
||||
const sfwMediaIds = inserted.map(mediaEntry => ({ media_id: mediaEntry.id }));
|
||||
|
||||
const sfwMediaIds = inserted.map(mediaEntry => ({
|
||||
id: nanoid(),
|
||||
media_id: mediaEntry.id,
|
||||
}));
|
||||
|
||||
await upsert('media_sfw', sfwMediaIds, 'media_id');
|
||||
})
|
||||
@@ -740,9 +749,9 @@ exports.seed = knex => Promise.resolve()
|
||||
const tags = await knex('tags').whereIn('slug', tagMedia.map(item => item.tagSlug));
|
||||
|
||||
const { inserted, updated } = await upsert('media', tagMedia.map(({
|
||||
path, thumbnail, mime, index, comment,
|
||||
id, path, thumbnail, mime, index, comment,
|
||||
}) => ({
|
||||
path, thumbnail, mime, index, comment,
|
||||
id, path, thumbnail, mime, index, comment,
|
||||
})), 'path', knex);
|
||||
|
||||
const tagIdsBySlug = tags.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag.id }), {});
|
||||
|
||||
Reference in New Issue
Block a user