2019-12-04 20:58:08 +00:00
const upsert = require ( '../src/utils/upsert' ) ;
function getMedia ( tagsMap ) {
return [
{
2019-12-06 04:09:08 +00:00
path : 'tags/airtight.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . airtight ,
role : 'poster' ,
comment : 'Jynx Maze in "Pump My Ass Full of Cum 3" for Jules Jordan' ,
} ,
{
path : 'tags/airtight/2.jpeg' ,
target _id : tagsMap . airtight ,
comment : 'Dakota Skye in "Dakota Goes Nuts" for ArchAngel' ,
} ,
{
path : 'tags/airtight/1.jpeg' ,
target _id : tagsMap . airtight ,
comment : 'Chloe Amour in "DP Masters 4" for Jules Jordan' ,
} ,
{
path : 'tags/airtight/0.jpeg' ,
domain : 'tags' ,
target _id : tagsMap . airtight ,
comment : 'Sheena Shaw in "Ass Worship 14" for Jules Jordan' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/anal.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . anal ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/double-penetration.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'double-penetration' ] ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/double-anal.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'double-anal' ] ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/double-vaginal.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'double-vaginal' ] ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/da-tp.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'da-tp' ] ,
role : 'poster' ,
comment : 'Ninel Mojado aka Mira Cuckold in GIO063 for LegalPorno' ,
} ,
{
path : 'tags/da-tp/1.jpeg' ,
target _id : tagsMap [ 'da-tp' ] ,
role : 'photo' ,
comment : 'Francys Belle in SZ1702 for LegalPorno' ,
} ,
{
path : 'tags/da-tp/2.jpeg' ,
target _id : tagsMap [ 'da-tp' ] ,
role : 'photo' ,
comment : 'Angel Smalls in GIO408 for LegalPorno' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/dv-tp.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'dv-tp' ] ,
role : 'poster' ,
comment : 'Juelz Ventura in "Gangbanged 5" for Elegant Angel' ,
} ,
2019-12-09 04:00:49 +00:00
{
path : 'tags/tattoo.jpeg' ,
target _id : tagsMap . tattoo ,
role : 'poster' ,
comment : 'Kali Roses in "Goes All In For Anal" for Hussie Pass' ,
} ,
2019-12-04 20:58:08 +00:00
{
2019-12-06 04:09:08 +00:00
path : 'tags/triple-anal.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'triple-anal' ] ,
role : 'poster' ,
comment : 'Kristy Black in SZ1986 for LegalPorno' ,
} ,
{
path : 'tags/triple-anal/1.jpeg' ,
target _id : tagsMap [ 'triple-anal' ] ,
role : 'photo' ,
comment : 'Natasha Teen in SZ2098 for LegalPorno' ,
} ,
{
path : 'tags/triple-anal/2.jpeg' ,
target _id : tagsMap [ 'triple-anal' ] ,
role : 'photo' ,
2019-12-05 00:26:22 +00:00
comment : 'Kira Thorn in GIO1018 for LegalPorno' ,
2019-12-04 20:58:08 +00:00
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/blowbang.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . blowbang ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/gangbang.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . gangbang ,
role : 'poster' ,
comment : '' ,
} ,
{
path : 'tags/gangbang/1.jpeg' ,
target _id : tagsMap . gangbang ,
role : 'photo' ,
comment : 'Ginger Lynn in "Gangbang Mystique", a photoset shot by Suze Randall for Puritan No. 10, 1984. This photo pushed the boundaries of pornography at the time, as depicting a woman \'fully occupied\' was unheard of.' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/gangbang/2.jpeg' ,
target _id : tagsMap . gangbang ,
role : 'photo' ,
comment : 'Riley Reid\'s double anal in "The Gangbang of Riley Reid" for Jules Jordan' ,
} ,
{
path : 'tags/gangbang/3.jpeg' ,
target _id : tagsMap . gangbang ,
role : 'photo' ,
comment : 'Kelsi Monroe in "Brazzers House 2, Day 2" for Brazzers' ,
} ,
{
path : 'tags/mff.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . mff ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/mfm.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . mfm ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/orgy.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . orgy ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/asian.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . asian ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/caucasian.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . caucasian ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/ebony.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . ebony ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/latina.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . latina ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/interracial.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . interracial ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/facial.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . facial ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/bukkake.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . bukkake ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/swallowing.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . swallowing ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/creampie.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap . creampie ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/anal-creampie.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'anal-creampie' ] ,
role : 'poster' ,
comment : '' ,
} ,
{
2019-12-06 04:09:08 +00:00
path : 'tags/oral-creampie.jpeg' ,
2019-12-04 20:58:08 +00:00
target _id : tagsMap [ 'oral-creampie' ] ,
role : 'poster' ,
comment : '' ,
} ,
]
. map ( ( file , index ) => ( {
... file ,
thumbnail : file . thumbnail || file . path . replace ( '.jpeg' , '_thumb.jpeg' ) ,
mime : 'image/jpeg' ,
index ,
domain : file . domain || 'tags' ,
role : file . role || 'photo' ,
} ) ) ;
}
/* eslint-disable max-len */
exports . seed = knex => Promise . resolve ( )
. then ( async ( ) => {
const [ duplicates , tags ] = await Promise . all ( [
knex ( 'media' ) . where ( 'domain' , 'tags' ) ,
knex ( 'tags' ) . where ( 'alias_for' , null ) ,
] ) ;
const duplicatesByPath = duplicates . reduce ( ( acc , file ) => ( { ... acc , [ file . path ] : file } ) , { } ) ;
const tagsMap = tags . reduce ( ( acc , { id , slug } ) => ( { ... acc , [ slug ] : id } ) , { } ) ;
const media = getMedia ( tagsMap ) ;
return upsert ( 'media' , media , duplicatesByPath , 'path' , knex ) ;
} ) ;