Updated all dependencies. Updated MindGeek to Aylo.

This commit is contained in:
DebaucheryLibrarian
2023-11-30 03:12:47 +01:00
parent 90aa29d2d4
commit 98bf7ea9dd
83 changed files with 9071 additions and 23082 deletions

View File

@@ -116,7 +116,7 @@ async function load() {
throw new Error(`No user ${alert.username}`);
}
const [alertId] = await knex('alerts')
const [{ id: alertId }] = await knex('alerts')
.insert({
user_id: user.id,
notify: alert.notify,

View File

@@ -22,7 +22,7 @@ async function getStashId(stash, user) {
return existingStash.id;
}
const [stashId] = await knex('stashes')
const [{ id: stashId }] = await knex('stashes')
.insert({
user_id: user.id,
name: stash.name,

View File

@@ -7,17 +7,16 @@ const moment = require('moment');
const Promise = require('bluebird');
const bhttp = require('bhttp');
const { nanoid } = require('nanoid/non-secure');
const AWS = require('aws-sdk');
const { Upload } = require('@aws-sdk/lib-storage');
const { S3Client } = require('@aws-sdk/client-s3');
const { graphql } = require('../web/graphql');
const knex = require('../knex');
const args = require('../argv');
const endpoint = new AWS.Endpoint('s3.eu-central-1.wasabisys.com');
const s3 = new AWS.S3({
// region: 'eu-central-1',
endpoint,
const s3 = new S3Client({
region: 'eu-central-1',
endpoint: 'https://s3.eu-central-1.wasabisys.com',
credentials: {
accessKeyId: config.s3.accessKey,
secretAccessKey: config.s3.secretKey,
@@ -325,7 +324,7 @@ async function addReleaseTags(release, context) {
}
async function addNewActor(actor, entity, context) {
const [actorId] = await knex('actors')
const [{ id: actorId }] = await knex('actors')
.insert({
name: actor.name,
slug: actor.slug,
@@ -379,7 +378,7 @@ async function addReleaseChapters(release, context) {
await release.chapters.reduce(async (chain, chapter) => {
await chain;
const [chapterId] = await knex('chapters')
const [{ id: chapterId }] = await knex('chapters')
.insert({
release_id: release.id,
index: chapter.index,
@@ -438,12 +437,15 @@ async function transferMedia(media, target) {
fileStream.on('error', () => { reject(); });
});
await s3.upload({
Bucket: config.s3.bucket,
Body: fs.createReadStream(temp),
Key: filepath,
ContentType: media.mime,
}).promise();
await new Upload({
client: s3,
params: {
Bucket: config.s3.bucket,
Body: fs.createReadStream(temp),
Key: filepath,
ContentType: media.mime,
},
}).done();
await fs.promises.unlink(temp);
}, Promise.resolve());
@@ -602,7 +604,7 @@ async function load() {
return;
}
const [batchId] = await knex('batches').insert({ comment: `import ${args.file}` }).returning('id');
const [{ id: batchId }] = await knex('batches').insert({ comment: `import ${args.file}` }).returning('id');
const aggTags = Array.from(new Set(releases.filter((release) => release.type === 'release').flatMap((release) => [...release.tags, ...release.chapters.flatMap((chapter) => chapter.tags)]).filter(Boolean)));
const aggStudios = Array.from(new Set(releases.map((release) => release.studio).filter(Boolean)));