Compare commits
No commits in common. "99c60a0f81c926c887ec64a0f4cba1a31d57fa00" and "837f675e4fd277db6674f6ad299b8641dec78bd6" have entirely different histories.
99c60a0f81
...
837f675e4f
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.7",
|
"version": "1.237.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.7",
|
"version": "1.237.6",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.458.0",
|
"@aws-sdk/client-s3": "^3.458.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx",
|
"name": "traxxx",
|
||||||
"version": "1.237.7",
|
"version": "1.237.6",
|
||||||
"description": "All the latest porn releases in one place",
|
"description": "All the latest porn releases in one place",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
const config = require('config');
|
|
||||||
const manticore = require('manticoresearch');
|
|
||||||
|
|
||||||
const mantiClient = new manticore.ApiClient();
|
|
||||||
|
|
||||||
mantiClient.basePath = `http://${config.database.manticore.host}:${config.database.manticore.httpPort}`;
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
searchApi: new manticore.SearchApi(mantiClient),
|
|
||||||
indexApi: new manticore.IndexApi(mantiClient),
|
|
||||||
utilsApi: new manticore.UtilsApi(),
|
|
||||||
};
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
|
|
||||||
const knex = require('./knex');
|
const knex = require('./knex');
|
||||||
const { indexApi } = require('./manticore');
|
|
||||||
const { HttpError } = require('./errors');
|
const { HttpError } = require('./errors');
|
||||||
const slugify = require('./utils/slugify');
|
const slugify = require('./utils/slugify');
|
||||||
const logger = require('./logger')(__filename);
|
const logger = require('./logger')(__filename);
|
||||||
|
|
@ -143,22 +142,10 @@ async function refreshActorsView() {
|
||||||
async function stashActor(actorId, stashId, sessionUser) {
|
async function stashActor(actorId, stashId, sessionUser) {
|
||||||
const stash = await fetchStash(stashId, sessionUser);
|
const stash = await fetchStash(stashId, sessionUser);
|
||||||
|
|
||||||
const [stashed] = await knex('stashes_actors')
|
await knex('stashes_actors')
|
||||||
.insert({
|
.insert({
|
||||||
stash_id: stash.id,
|
stash_id: stash.id,
|
||||||
actor_id: actorId,
|
actor_id: actorId,
|
||||||
})
|
|
||||||
.returning(['id', 'created_at']);
|
|
||||||
|
|
||||||
await indexApi.replace({
|
|
||||||
index: 'actors_stashed',
|
|
||||||
id: stashed.id,
|
|
||||||
doc: {
|
|
||||||
actor_id: actorId,
|
|
||||||
user_id: sessionUser.id,
|
|
||||||
stash_id: stashId,
|
|
||||||
created_at: Math.round(stashed.created_at.getTime() / 1000),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
refreshActorsView();
|
refreshActorsView();
|
||||||
|
|
@ -169,23 +156,10 @@ async function stashActor(actorId, stashId, sessionUser) {
|
||||||
async function stashScene(sceneId, stashId, sessionUser) {
|
async function stashScene(sceneId, stashId, sessionUser) {
|
||||||
const stash = await fetchStash(stashId, sessionUser);
|
const stash = await fetchStash(stashId, sessionUser);
|
||||||
|
|
||||||
const [stashed] = await knex('stashes_scenes')
|
await knex('stashes_scenes')
|
||||||
.insert({
|
.insert({
|
||||||
stash_id: stash.id,
|
stash_id: stash.id,
|
||||||
scene_id: sceneId,
|
scene_id: sceneId,
|
||||||
})
|
|
||||||
.returning(['id', 'created_at']);
|
|
||||||
|
|
||||||
await indexApi.replace({
|
|
||||||
index: 'scenes_stashed',
|
|
||||||
id: stashed.id,
|
|
||||||
doc: {
|
|
||||||
// ...doc.replace.doc,
|
|
||||||
scene_id: sceneId,
|
|
||||||
user_id: sessionUser.id,
|
|
||||||
stash_id: stashId,
|
|
||||||
created_at: Math.round(stashed.created_at.getTime() / 1000),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return fetchStashes('scene', sceneId, sessionUser);
|
return fetchStashes('scene', sceneId, sessionUser);
|
||||||
|
|
@ -194,22 +168,10 @@ async function stashScene(sceneId, stashId, sessionUser) {
|
||||||
async function stashMovie(movieId, stashId, sessionUser) {
|
async function stashMovie(movieId, stashId, sessionUser) {
|
||||||
const stash = await fetchStash(stashId, sessionUser);
|
const stash = await fetchStash(stashId, sessionUser);
|
||||||
|
|
||||||
const [stashed] = await knex('stashes_movies')
|
await knex('stashes_movies')
|
||||||
.insert({
|
.insert({
|
||||||
stash_id: stash.id,
|
stash_id: stash.id,
|
||||||
movie_id: movieId,
|
movie_id: movieId,
|
||||||
})
|
|
||||||
.returning(['id', 'created_at']);
|
|
||||||
|
|
||||||
await indexApi.replace({
|
|
||||||
index: 'movies_stashed',
|
|
||||||
id: stashed.id,
|
|
||||||
doc: {
|
|
||||||
movie_id: movieId,
|
|
||||||
user_id: sessionUser.id,
|
|
||||||
stash_id: stashId,
|
|
||||||
created_at: Math.round(stashed.created_at.getTime() / 1000),
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return fetchStashes('movie', movieId, sessionUser);
|
return fetchStashes('movie', movieId, sessionUser);
|
||||||
|
|
@ -226,19 +188,6 @@ async function unstashActor(actorId, stashId, sessionUser) {
|
||||||
.where('stashes.user_id', sessionUser.id))
|
.where('stashes.user_id', sessionUser.id))
|
||||||
.delete();
|
.delete();
|
||||||
|
|
||||||
await indexApi.callDelete({
|
|
||||||
index: 'actors_stashed',
|
|
||||||
query: {
|
|
||||||
bool: {
|
|
||||||
must: [
|
|
||||||
{ equals: { actor_id: actorId } },
|
|
||||||
{ equals: { stash_id: stashId } },
|
|
||||||
{ equals: { user_id: sessionUser.id } },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
refreshActorsView();
|
refreshActorsView();
|
||||||
|
|
||||||
return fetchStashes('actor', actorId, sessionUser);
|
return fetchStashes('actor', actorId, sessionUser);
|
||||||
|
|
@ -255,19 +204,6 @@ async function unstashScene(sceneId, stashId, sessionUser) {
|
||||||
.where('stashes.user_id', sessionUser.id))
|
.where('stashes.user_id', sessionUser.id))
|
||||||
.delete();
|
.delete();
|
||||||
|
|
||||||
await indexApi.callDelete({
|
|
||||||
index: 'scenes_stashed',
|
|
||||||
query: {
|
|
||||||
bool: {
|
|
||||||
must: [
|
|
||||||
{ equals: { scene_id: sceneId } },
|
|
||||||
{ equals: { stash_id: stashId } },
|
|
||||||
{ equals: { user_id: sessionUser.id } },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return fetchStashes('scene', sceneId, sessionUser);
|
return fetchStashes('scene', sceneId, sessionUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,19 +218,6 @@ async function unstashMovie(movieId, stashId, sessionUser) {
|
||||||
.where('stashes.user_id', sessionUser.id))
|
.where('stashes.user_id', sessionUser.id))
|
||||||
.delete();
|
.delete();
|
||||||
|
|
||||||
await indexApi.callDelete({
|
|
||||||
index: 'movies_stashed',
|
|
||||||
query: {
|
|
||||||
bool: {
|
|
||||||
must: [
|
|
||||||
{ equals: { movie_id: movieId } },
|
|
||||||
{ equals: { stash_id: stashId } },
|
|
||||||
{ equals: { user_id: sessionUser.id } },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return fetchStashes('movie', movieId, sessionUser);
|
return fetchStashes('movie', movieId, sessionUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,37 +31,37 @@ async function removeStashApi(req, res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function stashActorApi(req, res) {
|
async function stashActorApi(req, res) {
|
||||||
const stashes = await stashActor(req.body.actorId, Number(req.params.stashId), req.session.user);
|
const stashes = await stashActor(req.body.actorId, req.params.stashId, req.session.user);
|
||||||
|
|
||||||
res.send(stashes);
|
res.send(stashes);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function stashSceneApi(req, res) {
|
async function stashSceneApi(req, res) {
|
||||||
const stashes = await stashScene(req.body.sceneId, Number(req.params.stashId), req.session.user);
|
const stashes = await stashScene(req.body.sceneId, req.params.stashId, req.session.user);
|
||||||
|
|
||||||
res.send(stashes);
|
res.send(stashes);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function stashMovieApi(req, res) {
|
async function stashMovieApi(req, res) {
|
||||||
const stashes = await stashMovie(req.body.movieId, Number(req.params.stashId), req.session.user);
|
const stashes = await stashMovie(req.body.movieId, req.params.stashId, req.session.user);
|
||||||
|
|
||||||
res.send(stashes);
|
res.send(stashes);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unstashActorApi(req, res) {
|
async function unstashActorApi(req, res) {
|
||||||
const stashes = await unstashActor(Number(req.params.actorId), Number(req.params.stashId), req.session.user);
|
const stashes = await unstashActor(req.params.actorId, req.params.stashId, req.session.user);
|
||||||
|
|
||||||
res.send(stashes);
|
res.send(stashes);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unstashSceneApi(req, res) {
|
async function unstashSceneApi(req, res) {
|
||||||
const stashes = await unstashScene(Number(req.params.sceneId), Number(req.params.stashId), req.session.user);
|
const stashes = await unstashScene(req.params.sceneId, req.params.stashId, req.session.user);
|
||||||
|
|
||||||
res.send(stashes);
|
res.send(stashes);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unstashMovieApi(req, res) {
|
async function unstashMovieApi(req, res) {
|
||||||
const stashes = await unstashMovie(Number(req.params.movieId), Number(req.params.stashId), req.session.user);
|
const stashes = await unstashMovie(req.params.movieId, req.params.stashId, req.session.user);
|
||||||
|
|
||||||
res.send(stashes);
|
res.send(stashes);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue