Updated dependencies. Added periodic memory logger.

This commit is contained in:
DebaucheryLibrarian
2021-11-20 23:59:15 +01:00
parent a867817dc1
commit 26539b74a5
109 changed files with 10238 additions and 10833 deletions

View File

@@ -900,6 +900,7 @@ const tagMedia = [
['flexible', 'lara_frost_legalporno', 'Lara Frost in NRX059', 'legalporno'],
['free-use', 'jeni_angel_brazzersexxtra', 'Jeni Angel in "Gamer Girl Threesome Action"', 'brazzersexxtra'],
['free-use', 'veruca_james_brazzersexxtra', 'Veruca James in "The Perfect Maid"', 'brazzersexxtra'],
['free-use', 'gia_dibella_freeusefantasy', 'Gia Dibella in "Learning to Freeuse"', 'freeusefantasy'],
['gangbang', 5, 'Carter Cruise\'s first gangbang in "Slut Puppies 9"', 'julesjordan'],
['gangbang', 'kristen_scott_julesjordan', 'Kristen Scott in "Interracial Gangbang!"', 'julesjordan'],
['gangbang', 'emily_willis_blacked', 'Emily Willis', 'blacked'],
@@ -1066,14 +1067,14 @@ const tagMedia = [
}));
/* eslint-disable max-len */
exports.seed = knex => Promise.resolve()
exports.seed = (knex) => Promise.resolve()
.then(async () => {
await upsert('media', sfw, 'id');
const tags = await knex('tags').whereIn('slug', tagMedia.map(item => item.tagSlug));
const tags = await knex('tags').whereIn('slug', tagMedia.map((item) => item.tagSlug));
const entities = await knex('entities')
.whereIn('slug', tagMedia.map(item => item.entitySlug).filter(Boolean))
.whereIn('slug', tagMedia.map((item) => item.entitySlug).filter(Boolean))
.orderBy('type', 'DESC');
const entitiesBySlug = entities.reduce((acc, entity) => ({
@@ -1093,7 +1094,7 @@ exports.seed = knex => Promise.resolve()
concurrency: 20,
});
const { inserted, updated } = await upsert('media', tagMediaWithDimensions.map(media => ({
const { inserted, updated } = await upsert('media', tagMediaWithDimensions.map((media) => ({
id: media.id,
path: media.path,
thumbnail: media.thumbnail,
@@ -1114,15 +1115,15 @@ exports.seed = knex => Promise.resolve()
[tagPhoto.tagSlug]: (acc[tagPhoto.tagSlug] || []).concat(tagPhoto),
}), {});
const tagPosters = Object.values(tagMediaBySlug).map(tag => tag[0]);
const tagPhotos = Object.values(tagMediaBySlug).map(tag => tag.slice(1)).flat();
const tagPosters = Object.values(tagMediaBySlug).map((tag) => tag[0]);
const tagPhotos = Object.values(tagMediaBySlug).map((tag) => tag.slice(1)).flat();
const tagPosterEntries = tagPosters.map(poster => ({
const tagPosterEntries = tagPosters.map((poster) => ({
tag_id: tagIdsBySlug[poster.tagSlug],
media_id: mediaIdsByPath[poster.path],
}));
const tagPhotoEntries = tagPhotos.map(photo => ({
const tagPhotoEntries = tagPhotos.map((photo) => ({
tag_id: tagIdsBySlug[photo.tagSlug],
media_id: mediaIdsByPath[photo.path],
}));
@@ -1135,10 +1136,10 @@ exports.seed = knex => Promise.resolve()
// clean up (re)moved tag media
await Promise.all([
knex('tags_posters')
.whereNotIn('media_id', tagPosters.map(photo => photo.id))
.whereNotIn('media_id', tagPosters.map((photo) => photo.id))
.delete(),
knex('tags_photos')
.whereNotIn('media_id', tagPhotos.map(photo => photo.id))
.whereNotIn('media_id', tagPhotos.map((photo) => photo.id))
.delete(),
]);
});