Compare commits
No commits in common. "6e56f8c9fea8da4da5d9534ba2098f39bbf11aa9" and "15cfed217b445d40c999377bf4f380a159be9396" have entirely different histories.
6e56f8c9fe
...
15cfed217b
|
@ -1,107 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="years-container">
|
|
||||||
<select
|
|
||||||
v-model="selected"
|
|
||||||
class="years nobar"
|
|
||||||
multiple
|
|
||||||
@change="updateYears"
|
|
||||||
>
|
|
||||||
<option
|
|
||||||
v-for="year in years"
|
|
||||||
:key="`year-${year.year}`"
|
|
||||||
class="year"
|
|
||||||
:value="year.year"
|
|
||||||
>{{ year.year }}</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<Icon
|
|
||||||
v-show="selected.length > 0"
|
|
||||||
icon="cross2"
|
|
||||||
class="clear"
|
|
||||||
@click="clearYears"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
filters: {
|
|
||||||
type: Object,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
years: {
|
|
||||||
type: Array,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['update']);
|
|
||||||
const selected = ref(props.filters.years);
|
|
||||||
|
|
||||||
function updateYears() {
|
|
||||||
emit('update', 'years', selected.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function clearYears() {
|
|
||||||
selected.value = [];
|
|
||||||
emit('update', 'years', selected.value);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.years-container {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
border-bottom: solid 1px var(--shadow-weak-30);
|
|
||||||
}
|
|
||||||
|
|
||||||
.years {
|
|
||||||
height: 2.5rem;
|
|
||||||
padding: .5rem;
|
|
||||||
flex-grow: 1;
|
|
||||||
border: none;
|
|
||||||
overflow-x: auto;
|
|
||||||
overflow-y: hidden;
|
|
||||||
background: none;
|
|
||||||
|
|
||||||
&:focus .year:checked {
|
|
||||||
background: var(--primary) linear-gradient(0deg, var(--primary) 0%, var(--primary) 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.year {
|
|
||||||
display: inline-block;
|
|
||||||
padding: .25rem;
|
|
||||||
font-size: .8rem;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: var(--primary);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:checked {
|
|
||||||
color: var(--primary);
|
|
||||||
background: none;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.clear {
|
|
||||||
height: auto;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 .5rem;
|
|
||||||
fill: var(--shadow);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
fill: var(--primary);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -11,11 +11,11 @@
|
||||||
><Icon icon="discord" /></a>
|
><Icon icon="discord" /></a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
v-if="env.links.content"
|
v-if="env.links.dmca"
|
||||||
:href="env.links.content"
|
:href="env.links.dmca"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="footer-segment footer-link"
|
class="footer-segment footer-link"
|
||||||
>Content Removal / DMCA</a>
|
>dmca</a>
|
||||||
</footer>
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,6 @@
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<YearsFilter
|
|
||||||
:filters="filters"
|
|
||||||
:years="aggYears"
|
|
||||||
@update="updateFilter"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TagsFilter
|
<TagsFilter
|
||||||
:filters="filters"
|
:filters="filters"
|
||||||
:tags="aggTags"
|
:tags="aggTags"
|
||||||
|
@ -96,7 +90,6 @@ import events from '#/src/events.js';
|
||||||
|
|
||||||
import MovieTile from '#/components/movies/tile.vue';
|
import MovieTile from '#/components/movies/tile.vue';
|
||||||
import Filters from '#/components/filters/filters.vue';
|
import Filters from '#/components/filters/filters.vue';
|
||||||
import YearsFilter from '#/components/filters/years.vue';
|
|
||||||
import ActorsFilter from '#/components/filters/actors.vue';
|
import ActorsFilter from '#/components/filters/actors.vue';
|
||||||
import TagsFilter from '#/components/filters/tags.vue';
|
import TagsFilter from '#/components/filters/tags.vue';
|
||||||
import ChannelsFilter from '#/components/filters/channels.vue';
|
import ChannelsFilter from '#/components/filters/channels.vue';
|
||||||
|
@ -113,7 +106,6 @@ const {
|
||||||
} = pageProps;
|
} = pageProps;
|
||||||
|
|
||||||
const movies = ref(pageProps.movies);
|
const movies = ref(pageProps.movies);
|
||||||
const aggYears = ref(pageProps.aggYears || []);
|
|
||||||
const aggActors = ref(pageProps.aggActors || []);
|
const aggActors = ref(pageProps.aggActors || []);
|
||||||
const aggTags = ref(pageProps.aggTags || []);
|
const aggTags = ref(pageProps.aggTags || []);
|
||||||
const aggChannels = ref(pageProps.aggChannels || []);
|
const aggChannels = ref(pageProps.aggChannels || []);
|
||||||
|
@ -135,7 +127,6 @@ const queryEntity = networks[urlParsed.search.e] || channels[urlParsed.search.e]
|
||||||
|
|
||||||
const filters = ref({
|
const filters = ref({
|
||||||
search: urlParsed.search.q,
|
search: urlParsed.search.q,
|
||||||
years: urlParsed.search.years?.split(',').map((year) => Number(year)).filter(Boolean) || [],
|
|
||||||
tags: urlParsed.search.tags?.split(',').filter(Boolean) || [],
|
tags: urlParsed.search.tags?.split(',').filter(Boolean) || [],
|
||||||
entity: queryEntity,
|
entity: queryEntity,
|
||||||
actors: queryActors,
|
actors: queryActors,
|
||||||
|
@ -187,7 +178,6 @@ async function search(options = {}) {
|
||||||
|
|
||||||
navigate(getPath(scope.value, false), {
|
navigate(getPath(scope.value, false), {
|
||||||
...query,
|
...query,
|
||||||
years: filters.value.years.join(',') || undefined,
|
|
||||||
actors: filters.value.actors.map((filterActor) => getActorIdentifier(filterActor)).join(',') || undefined, // don't include page actor ID in query, already a parameter
|
actors: filters.value.actors.map((filterActor) => getActorIdentifier(filterActor)).join(',') || undefined, // don't include page actor ID in query, already a parameter
|
||||||
tags: filters.value.tags.join(',') || undefined,
|
tags: filters.value.tags.join(',') || undefined,
|
||||||
e: filters.value.entity?.type === 'network' ? `_${filters.value.entity.slug}` : (filters.value.entity?.slug || undefined),
|
e: filters.value.entity?.type === 'network' ? `_${filters.value.entity.slug}` : (filters.value.entity?.slug || undefined),
|
||||||
|
@ -195,7 +185,6 @@ async function search(options = {}) {
|
||||||
|
|
||||||
const res = await get('/movies', {
|
const res = await get('/movies', {
|
||||||
...query,
|
...query,
|
||||||
years: filters.value.years.filter(Boolean).join(','), // if we're on an actor page, that actor ID needs to be included
|
|
||||||
actors: [pageActor, ...filters.value.actors].filter(Boolean).map((filterActor) => getActorIdentifier(filterActor)).join(','), // if we're on an actor page, that actor ID needs to be included
|
actors: [pageActor, ...filters.value.actors].filter(Boolean).map((filterActor) => getActorIdentifier(filterActor)).join(','), // if we're on an actor page, that actor ID needs to be included
|
||||||
tags: [pageTag?.slug, ...filters.value.tags].filter(Boolean).join(','),
|
tags: [pageTag?.slug, ...filters.value.tags].filter(Boolean).join(','),
|
||||||
e: entitySlug,
|
e: entitySlug,
|
||||||
|
@ -205,7 +194,6 @@ async function search(options = {}) {
|
||||||
});
|
});
|
||||||
|
|
||||||
movies.value = res.movies;
|
movies.value = res.movies;
|
||||||
aggYears.value = res.aggYears;
|
|
||||||
aggActors.value = res.aggActors;
|
aggActors.value = res.aggActors;
|
||||||
aggTags.value = res.aggTags;
|
aggTags.value = res.aggTags;
|
||||||
aggChannels.value = res.aggChannels;
|
aggChannels.value = res.aggChannels;
|
||||||
|
|
|
@ -24,12 +24,6 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<YearsFilter
|
|
||||||
:filters="filters"
|
|
||||||
:years="aggYears"
|
|
||||||
@update="updateFilter"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TagsFilter
|
<TagsFilter
|
||||||
:filters="filters"
|
:filters="filters"
|
||||||
:tags="aggTags"
|
:tags="aggTags"
|
||||||
|
@ -163,7 +157,6 @@ import events from '#/src/events.js';
|
||||||
import { getActorIdentifier, parseActorIdentifier } from '#/src/query.js';
|
import { getActorIdentifier, parseActorIdentifier } from '#/src/query.js';
|
||||||
|
|
||||||
import Filters from '#/components/filters/filters.vue';
|
import Filters from '#/components/filters/filters.vue';
|
||||||
import YearsFilter from '#/components/filters/years.vue';
|
|
||||||
import ActorsFilter from '#/components/filters/actors.vue';
|
import ActorsFilter from '#/components/filters/actors.vue';
|
||||||
import TagsFilter from '#/components/filters/tags.vue';
|
import TagsFilter from '#/components/filters/tags.vue';
|
||||||
import ChannelsFilter from '#/components/filters/channels.vue';
|
import ChannelsFilter from '#/components/filters/channels.vue';
|
||||||
|
@ -206,7 +199,6 @@ const {
|
||||||
} = pageProps;
|
} = pageProps;
|
||||||
|
|
||||||
const scenes = ref(pageProps.scenes);
|
const scenes = ref(pageProps.scenes);
|
||||||
const aggYears = ref(pageProps.aggYears || []);
|
|
||||||
const aggActors = ref(pageProps.aggActors || []);
|
const aggActors = ref(pageProps.aggActors || []);
|
||||||
const aggTags = ref(pageProps.aggTags || []);
|
const aggTags = ref(pageProps.aggTags || []);
|
||||||
const aggChannels = ref(pageProps.aggChannels || []);
|
const aggChannels = ref(pageProps.aggChannels || []);
|
||||||
|
@ -226,7 +218,6 @@ const queryEntity = networks[urlParsed.search.e] || channels[urlParsed.search.e]
|
||||||
|
|
||||||
const filters = ref({
|
const filters = ref({
|
||||||
search: urlParsed.search.q,
|
search: urlParsed.search.q,
|
||||||
years: urlParsed.search.years?.split(',').filter(Boolean).map(Number) || [],
|
|
||||||
tags: urlParsed.search.tags?.split(',').filter(Boolean) || [],
|
tags: urlParsed.search.tags?.split(',').filter(Boolean) || [],
|
||||||
entity: queryEntity,
|
entity: queryEntity,
|
||||||
actors: queryActors,
|
actors: queryActors,
|
||||||
|
@ -283,7 +274,6 @@ async function search(options = {}) {
|
||||||
|
|
||||||
navigate(getPath(scope.value, false), {
|
navigate(getPath(scope.value, false), {
|
||||||
...query,
|
...query,
|
||||||
years: filters.value.years.join(',') || undefined,
|
|
||||||
actors: filters.value.actors.map((filterActor) => getActorIdentifier(filterActor)).join(',') || undefined, // don't include page actor ID in query, already a parameter
|
actors: filters.value.actors.map((filterActor) => getActorIdentifier(filterActor)).join(',') || undefined, // don't include page actor ID in query, already a parameter
|
||||||
tags: filters.value.tags.join(',') || undefined,
|
tags: filters.value.tags.join(',') || undefined,
|
||||||
e: filters.value.entity?.type === 'network' ? `_${filters.value.entity.slug}` : (filters.value.entity?.slug || undefined),
|
e: filters.value.entity?.type === 'network' ? `_${filters.value.entity.slug}` : (filters.value.entity?.slug || undefined),
|
||||||
|
@ -291,7 +281,6 @@ async function search(options = {}) {
|
||||||
|
|
||||||
const res = await get('/scenes', {
|
const res = await get('/scenes', {
|
||||||
...query,
|
...query,
|
||||||
years: filters.value.years.filter(Boolean).join(','), // if we're on an actor page, that actor ID needs to be included
|
|
||||||
actors: [pageActor, ...filters.value.actors].filter(Boolean).map((filterActor) => getActorIdentifier(filterActor)).join(','), // if we're on an actor page, that actor ID needs to be included
|
actors: [pageActor, ...filters.value.actors].filter(Boolean).map((filterActor) => getActorIdentifier(filterActor)).join(','), // if we're on an actor page, that actor ID needs to be included
|
||||||
tags: [pageTag?.slug, ...filters.value.tags].filter(Boolean).join(','),
|
tags: [pageTag?.slug, ...filters.value.tags].filter(Boolean).join(','),
|
||||||
stashId: pageStash?.id,
|
stashId: pageStash?.id,
|
||||||
|
@ -301,7 +290,6 @@ async function search(options = {}) {
|
||||||
});
|
});
|
||||||
|
|
||||||
scenes.value = res.scenes;
|
scenes.value = res.scenes;
|
||||||
aggYears.value = res.aggYears;
|
|
||||||
aggActors.value = res.aggActors;
|
aggActors.value = res.aggActors;
|
||||||
aggTags.value = res.aggTags;
|
aggTags.value = res.aggTags;
|
||||||
aggChannels.value = res.aggChannels;
|
aggChannels.value = res.aggChannels;
|
||||||
|
|
|
@ -70,7 +70,7 @@ module.exports = {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
links: {
|
links: {
|
||||||
content: 'mailto:content@traxxx.me',
|
dmca: 'mailto:dmca@traxxx.me',
|
||||||
discord: 'https://discord.gg/gY6fnq6jJV',
|
discord: 'https://discord.gg/gY6fnq6jJV',
|
||||||
},
|
},
|
||||||
stashes: {
|
stashes: {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx-web",
|
"name": "traxxx-web",
|
||||||
"version": "0.27.0",
|
"version": "0.26.6",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"version": "0.27.0",
|
"version": "0.26.6",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brillout/json-serializer": "^0.5.8",
|
"@brillout/json-serializer": "^0.5.8",
|
||||||
"@dicebear/collection": "^7.0.5",
|
"@dicebear/collection": "^7.0.5",
|
||||||
|
|
|
@ -78,5 +78,5 @@
|
||||||
"postcss-custom-media": "^10.0.2",
|
"postcss-custom-media": "^10.0.2",
|
||||||
"postcss-nesting": "^12.0.2"
|
"postcss-nesting": "^12.0.2"
|
||||||
},
|
},
|
||||||
"version": "0.27.0"
|
"version": "0.26.6"
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,26 @@ export async function onBeforeRender(pageContext) {
|
||||||
throw render(404, `Cannot find actor '${pageContext.routeParams.actorId}'.`);
|
throw render(404, `Cannot find actor '${pageContext.routeParams.actorId}'.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
scenes,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
|
} = actorScenes;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageContext: {
|
pageContext: {
|
||||||
title: actor.name,
|
title: actor.name,
|
||||||
pageProps: {
|
pageProps: {
|
||||||
actor,
|
actor,
|
||||||
...actorScenes,
|
scenes,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,6 +51,11 @@ export async function onBeforeRender(pageContext) {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
scenes,
|
scenes,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
} = entityScenes;
|
} = entityScenes;
|
||||||
|
|
||||||
const campaignIndex = Math.floor((Math.random() * (0.5 - 0.2) + 0.2) * scenes.length);
|
const campaignIndex = Math.floor((Math.random() * (0.5 - 0.2) + 0.2) * scenes.length);
|
||||||
|
@ -61,7 +66,12 @@ export async function onBeforeRender(pageContext) {
|
||||||
title: entity.name,
|
title: entity.name,
|
||||||
pageProps: {
|
pageProps: {
|
||||||
entity,
|
entity,
|
||||||
...entityScenes,
|
scenes,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
},
|
},
|
||||||
campaigns: {
|
campaigns: {
|
||||||
index: campaignIndex,
|
index: campaignIndex,
|
||||||
|
|
|
@ -10,11 +10,25 @@ export async function onBeforeRender(pageContext) {
|
||||||
limit: Number(pageContext.urlParsed.search.limit) || 50,
|
limit: Number(pageContext.urlParsed.search.limit) || 50,
|
||||||
}, pageContext.user);
|
}, pageContext.user);
|
||||||
|
|
||||||
|
const {
|
||||||
|
movies,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
|
} = movieResults;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageContext: {
|
pageContext: {
|
||||||
title: 'Movies',
|
title: 'Movies',
|
||||||
pageProps: {
|
pageProps: {
|
||||||
...movieResults,
|
movies,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
limit,
|
||||||
|
total,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,6 @@ export async function onBeforeRender(pageContext) {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
scenes,
|
scenes,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
@ -56,7 +55,6 @@ export async function onBeforeRender(pageContext) {
|
||||||
actors,
|
actors,
|
||||||
scenes,
|
scenes,
|
||||||
movies,
|
movies,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
|
|
@ -32,6 +32,11 @@ export async function onBeforeRender(pageContext) {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
scenes,
|
scenes,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
} = tagScenes;
|
} = tagScenes;
|
||||||
|
|
||||||
const description = tag.description && md.renderInline(tag.description);
|
const description = tag.description && md.renderInline(tag.description);
|
||||||
|
@ -45,7 +50,12 @@ export async function onBeforeRender(pageContext) {
|
||||||
pageProps: {
|
pageProps: {
|
||||||
tag,
|
tag,
|
||||||
description,
|
description,
|
||||||
...tagScenes,
|
scenes,
|
||||||
|
aggActors,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
total,
|
||||||
|
limit,
|
||||||
},
|
},
|
||||||
campaigns: {
|
campaigns: {
|
||||||
index: campaignIndex,
|
index: campaignIndex,
|
||||||
|
|
|
@ -28,6 +28,11 @@ export async function onBeforeRender(pageContext) {
|
||||||
|
|
||||||
const {
|
const {
|
||||||
scenes,
|
scenes,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
aggActors,
|
||||||
|
limit,
|
||||||
|
total,
|
||||||
} = sceneResults;
|
} = sceneResults;
|
||||||
|
|
||||||
const campaignIndex = getCampaignIndex(scenes.length);
|
const campaignIndex = getCampaignIndex(scenes.length);
|
||||||
|
@ -37,7 +42,12 @@ export async function onBeforeRender(pageContext) {
|
||||||
pageContext: {
|
pageContext: {
|
||||||
title: pageContext.routeParams.scope,
|
title: pageContext.routeParams.scope,
|
||||||
pageProps: {
|
pageProps: {
|
||||||
...sceneResults,
|
scenes,
|
||||||
|
aggTags,
|
||||||
|
aggChannels,
|
||||||
|
aggActors,
|
||||||
|
limit,
|
||||||
|
total,
|
||||||
},
|
},
|
||||||
campaigns: {
|
campaigns: {
|
||||||
index: campaignIndex,
|
index: campaignIndex,
|
||||||
|
|
|
@ -181,7 +181,6 @@ function curateOptions(options) {
|
||||||
limit: options?.limit || 30,
|
limit: options?.limit || 30,
|
||||||
page: Number(options?.page) || 1,
|
page: Number(options?.page) || 1,
|
||||||
aggregate: options.aggregate ?? true,
|
aggregate: options.aggregate ?? true,
|
||||||
aggregateYears: (options.aggregate ?? true) && (options.aggregateYears ?? true),
|
|
||||||
aggregateActors: (options.aggregate ?? true) && (options.aggregateActors ?? true),
|
aggregateActors: (options.aggregate ?? true) && (options.aggregateActors ?? true),
|
||||||
aggregateTags: (options.aggregate ?? true) && (options.aggregateTags ?? true),
|
aggregateTags: (options.aggregate ?? true) && (options.aggregateTags ?? true),
|
||||||
aggregateChannels: (options.aggregate ?? true) && (options.aggregateChannels ?? true),
|
aggregateChannels: (options.aggregate ?? true) && (options.aggregateChannels ?? true),
|
||||||
|
@ -206,7 +205,6 @@ async function queryManticoreSql(filters, options) {
|
||||||
),
|
),
|
||||||
max_matches=:maxMatches:,
|
max_matches=:maxMatches:,
|
||||||
max_query_time=:maxQueryTime:
|
max_query_time=:maxQueryTime:
|
||||||
:yearsFacet:
|
|
||||||
:actorsFacet:
|
:actorsFacet:
|
||||||
:tagsFacet:
|
:tagsFacet:
|
||||||
:channelsFacet:;
|
:channelsFacet:;
|
||||||
|
@ -227,7 +225,6 @@ async function queryManticoreSql(filters, options) {
|
||||||
movies.stashed as stashed,
|
movies.stashed as stashed,
|
||||||
movies.created_at,
|
movies.created_at,
|
||||||
created_at as stashed_at,
|
created_at as stashed_at,
|
||||||
year(effective_date) as effective_year,
|
|
||||||
weight() as _score
|
weight() as _score
|
||||||
`));
|
`));
|
||||||
|
|
||||||
|
@ -235,21 +232,13 @@ async function queryManticoreSql(filters, options) {
|
||||||
.innerJoin('movies', 'movies.id', 'movies_stashed.movie_id')
|
.innerJoin('movies', 'movies.id', 'movies_stashed.movie_id')
|
||||||
.where('stash_id', filters.stashId);
|
.where('stash_id', filters.stashId);
|
||||||
} else {
|
} else {
|
||||||
builder.select(knex.raw(`
|
builder.select(knex.raw('*, weight() as _score'));
|
||||||
*,
|
|
||||||
year(effective_date) as effective_year,
|
|
||||||
weight() as _score
|
|
||||||
`));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filters.query) {
|
if (filters.query) {
|
||||||
builder.whereRaw('match(\'@!title :query:\', movies)', { query: escape(filters.query) });
|
builder.whereRaw('match(\'@!title :query:\', movies)', { query: escape(filters.query) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filters.years?.length > 0) {
|
|
||||||
builder.whereIn('effective_year', filters.years);
|
|
||||||
}
|
|
||||||
|
|
||||||
filters.tagIds?.forEach((tagId) => {
|
filters.tagIds?.forEach((tagId) => {
|
||||||
builder.where('any(tag_ids)', tagId);
|
builder.where('any(tag_ids)', tagId);
|
||||||
});
|
});
|
||||||
|
@ -303,7 +292,6 @@ async function queryManticoreSql(filters, options) {
|
||||||
.offset((options.page - 1) * options.limit)
|
.offset((options.page - 1) * options.limit)
|
||||||
.toString(),
|
.toString(),
|
||||||
// option threads=1 fixes actors, but drastically slows down performance, wait for fix
|
// option threads=1 fixes actors, but drastically slows down performance, wait for fix
|
||||||
yearsFacet: options.aggregateYears ? knex.raw('facet year(effective_date) as years order by years desc limit ?', [aggSize]) : null,
|
|
||||||
actorsFacet: options.aggregateActors ? knex.raw('facet movies.actor_ids order by count(*) desc limit ?', [aggSize]) : null,
|
actorsFacet: options.aggregateActors ? knex.raw('facet movies.actor_ids order by count(*) desc limit ?', [aggSize]) : null,
|
||||||
tagsFacet: options.aggregateTags ? knex.raw('facet movies.tag_ids order by count(*) desc limit ?', [aggSize]) : null,
|
tagsFacet: options.aggregateTags ? knex.raw('facet movies.tag_ids order by count(*) desc limit ?', [aggSize]) : null,
|
||||||
channelsFacet: options.aggregateChannels ? knex.raw('facet movies.channel_id order by count(*) desc limit ?', [aggSize]) : null,
|
channelsFacet: options.aggregateChannels ? knex.raw('facet movies.channel_id order by count(*) desc limit ?', [aggSize]) : null,
|
||||||
|
@ -323,10 +311,6 @@ async function queryManticoreSql(filters, options) {
|
||||||
const results = await utilsApi.sql(curatedSqlQuery);
|
const results = await utilsApi.sql(curatedSqlQuery);
|
||||||
|
|
||||||
// console.log(results[0]);
|
// console.log(results[0]);
|
||||||
const years = results
|
|
||||||
.find((result) => (result.columns[0].years || result.columns[0]['movies.years']) && result.columns[1]['count(*)'])
|
|
||||||
?.data.map((row) => ({ key: row.years || row['movies.years'], doc_count: row['count(*)'] }))
|
|
||||||
|| [];
|
|
||||||
|
|
||||||
const actorIds = results
|
const actorIds = results
|
||||||
.find((result) => (result.columns[0].actor_ids || result.columns[0]['movies.actor_ids']) && result.columns[1]['count(*)'])
|
.find((result) => (result.columns[0].actor_ids || result.columns[0]['movies.actor_ids']) && result.columns[1]['count(*)'])
|
||||||
|
@ -349,7 +333,6 @@ async function queryManticoreSql(filters, options) {
|
||||||
movies: results[0].data,
|
movies: results[0].data,
|
||||||
total,
|
total,
|
||||||
aggregations: {
|
aggregations: {
|
||||||
years,
|
|
||||||
actorIds,
|
actorIds,
|
||||||
tagIds,
|
tagIds,
|
||||||
channelIds,
|
channelIds,
|
||||||
|
@ -373,8 +356,6 @@ export async function fetchMovies(filters, rawOptions, reqUser) {
|
||||||
|
|
||||||
const result = await queryManticoreSql(filters, options);
|
const result = await queryManticoreSql(filters, options);
|
||||||
|
|
||||||
const aggYears = options.aggregateYears && result.aggregations.years.map((bucket) => ({ year: bucket.key, count: bucket.doc_count }));
|
|
||||||
|
|
||||||
const actorCounts = options.aggregateActors && countAggregations(result.aggregations?.actorIds);
|
const actorCounts = options.aggregateActors && countAggregations(result.aggregations?.actorIds);
|
||||||
const tagCounts = options.aggregateTags && countAggregations(result.aggregations?.tagIds);
|
const tagCounts = options.aggregateTags && countAggregations(result.aggregations?.tagIds);
|
||||||
const channelCounts = options.aggregateChannels && countAggregations(result.aggregations?.channelIds);
|
const channelCounts = options.aggregateChannels && countAggregations(result.aggregations?.channelIds);
|
||||||
|
@ -390,7 +371,6 @@ export async function fetchMovies(filters, rawOptions, reqUser) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
movies,
|
movies,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
|
|
@ -306,7 +306,6 @@ function curateOptions(options) {
|
||||||
limit: options?.limit || 30,
|
limit: options?.limit || 30,
|
||||||
page: Number(options?.page) || 1,
|
page: Number(options?.page) || 1,
|
||||||
aggregate: options.aggregate ?? true,
|
aggregate: options.aggregate ?? true,
|
||||||
aggregateYears: (options.aggregate ?? true) && (options.aggregateYears ?? true),
|
|
||||||
aggregateActors: (options.aggregate ?? true) && (options.aggregateActors ?? true),
|
aggregateActors: (options.aggregate ?? true) && (options.aggregateActors ?? true),
|
||||||
aggregateTags: (options.aggregate ?? true) && (options.aggregateTags ?? true),
|
aggregateTags: (options.aggregate ?? true) && (options.aggregateTags ?? true),
|
||||||
aggregateChannels: (options.aggregate ?? true) && (options.aggregateChannels ?? true),
|
aggregateChannels: (options.aggregate ?? true) && (options.aggregateChannels ?? true),
|
||||||
|
@ -333,7 +332,6 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
),
|
),
|
||||||
max_matches=:maxMatches:,
|
max_matches=:maxMatches:,
|
||||||
max_query_time=:maxQueryTime:
|
max_query_time=:maxQueryTime:
|
||||||
:yearsFacet:
|
|
||||||
:actorsFacet:
|
:actorsFacet:
|
||||||
:tagsFacet:
|
:tagsFacet:
|
||||||
:channelsFacet:;
|
:channelsFacet:;
|
||||||
|
@ -354,7 +352,6 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
scenes.stashed as stashed,
|
scenes.stashed as stashed,
|
||||||
scenes.created_at,
|
scenes.created_at,
|
||||||
created_at as stashed_at,
|
created_at as stashed_at,
|
||||||
year(effective_date) as effective_year,
|
|
||||||
weight() as _score
|
weight() as _score
|
||||||
`));
|
`));
|
||||||
|
|
||||||
|
@ -362,21 +359,13 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
.innerJoin('scenes', 'scenes.id', 'scenes_stashed.scene_id')
|
.innerJoin('scenes', 'scenes.id', 'scenes_stashed.scene_id')
|
||||||
.where('stash_id', filters.stashId);
|
.where('stash_id', filters.stashId);
|
||||||
} else {
|
} else {
|
||||||
builder.select(knex.raw(`
|
builder.select(knex.raw('*, weight() as _score'));
|
||||||
*,
|
|
||||||
year(effective_date) as effective_year,
|
|
||||||
weight() as _score
|
|
||||||
`));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filters.query) {
|
if (filters.query) {
|
||||||
builder.whereRaw('match(\'@!title :query:\', scenes)', { query: escape(filters.query) });
|
builder.whereRaw('match(\'@!title :query:\', scenes)', { query: escape(filters.query) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filters.years?.length > 0) {
|
|
||||||
builder.whereIn('effective_year', filters.years);
|
|
||||||
}
|
|
||||||
|
|
||||||
filters.tagIds?.forEach((tagId) => {
|
filters.tagIds?.forEach((tagId) => {
|
||||||
builder.where('any(tag_ids)', tagId);
|
builder.where('any(tag_ids)', tagId);
|
||||||
});
|
});
|
||||||
|
@ -463,7 +452,6 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
.limit(options.limit)
|
.limit(options.limit)
|
||||||
.offset((options.page - 1) * options.limit),
|
.offset((options.page - 1) * options.limit),
|
||||||
// option threads=1 fixes actors, but drastically slows down performance, wait for fix
|
// option threads=1 fixes actors, but drastically slows down performance, wait for fix
|
||||||
yearsFacet: options.aggregateYears ? knex.raw('facet year(effective_date) as years order by years desc limit ?', [aggSize]) : null,
|
|
||||||
actorsFacet: options.aggregateActors ? knex.raw('facet scenes.actor_ids order by count(*) desc limit ?', [aggSize]) : null,
|
actorsFacet: options.aggregateActors ? knex.raw('facet scenes.actor_ids order by count(*) desc limit ?', [aggSize]) : null,
|
||||||
tagsFacet: options.aggregateTags ? knex.raw('facet scenes.tag_ids order by count(*) desc limit ?', [aggSize]) : null,
|
tagsFacet: options.aggregateTags ? knex.raw('facet scenes.tag_ids order by count(*) desc limit ?', [aggSize]) : null,
|
||||||
channelsFacet: options.aggregateChannels ? knex.raw('facet scenes.channel_id order by count(*) desc limit ?', [aggSize]) : null,
|
channelsFacet: options.aggregateChannels ? knex.raw('facet scenes.channel_id order by count(*) desc limit ?', [aggSize]) : null,
|
||||||
|
@ -482,12 +470,7 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
|
|
||||||
const results = await utilsApi.sql(curatedSqlQuery);
|
const results = await utilsApi.sql(curatedSqlQuery);
|
||||||
|
|
||||||
// console.log(util.inspect(results, null, Infinity));
|
// console.log(results[0]);
|
||||||
|
|
||||||
const years = results
|
|
||||||
.find((result) => (result.columns[0].years || result.columns[0]['scenes.years']) && result.columns[1]['count(*)'])
|
|
||||||
?.data.map((row) => ({ key: row.years || row['scenes.years'], doc_count: row['count(*)'] }))
|
|
||||||
|| [];
|
|
||||||
|
|
||||||
const actorIds = results
|
const actorIds = results
|
||||||
.find((result) => (result.columns[0].actor_ids || result.columns[0]['scenes.actor_ids']) && result.columns[1]['count(*)'])
|
.find((result) => (result.columns[0].actor_ids || result.columns[0]['scenes.actor_ids']) && result.columns[1]['count(*)'])
|
||||||
|
@ -510,7 +493,6 @@ async function queryManticoreSql(filters, options, _reqUser) {
|
||||||
scenes: results[0].data,
|
scenes: results[0].data,
|
||||||
total,
|
total,
|
||||||
aggregations: {
|
aggregations: {
|
||||||
years,
|
|
||||||
actorIds,
|
actorIds,
|
||||||
tagIds,
|
tagIds,
|
||||||
channelIds,
|
channelIds,
|
||||||
|
@ -536,8 +518,6 @@ export async function fetchScenes(filters, rawOptions, reqUser) {
|
||||||
const result = await queryManticoreSql(filters, options, reqUser);
|
const result = await queryManticoreSql(filters, options, reqUser);
|
||||||
console.timeEnd('manticore sql');
|
console.timeEnd('manticore sql');
|
||||||
|
|
||||||
const aggYears = options.aggregateYears && result.aggregations.years.map((bucket) => ({ year: bucket.key, count: bucket.doc_count }));
|
|
||||||
|
|
||||||
const actorCounts = options.aggregateActors && countAggregations(result.aggregations?.actorIds);
|
const actorCounts = options.aggregateActors && countAggregations(result.aggregations?.actorIds);
|
||||||
const tagCounts = options.aggregateTags && countAggregations(result.aggregations?.tagIds);
|
const tagCounts = options.aggregateTags && countAggregations(result.aggregations?.tagIds);
|
||||||
const channelCounts = options.aggregateChannels && countAggregations(result.aggregations?.channelIds);
|
const channelCounts = options.aggregateChannels && countAggregations(result.aggregations?.channelIds);
|
||||||
|
@ -559,7 +539,6 @@ export async function fetchScenes(filters, rawOptions, reqUser) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
scenes,
|
scenes,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
|
|
@ -8,7 +8,6 @@ export async function curateMoviesQuery(query) {
|
||||||
return {
|
return {
|
||||||
scope: query.scope || 'latest',
|
scope: query.scope || 'latest',
|
||||||
query: query.q,
|
query: query.q,
|
||||||
years: query.years?.split(',')?.map((year) => Number(year)).filter(Boolean) || [],
|
|
||||||
actorIds: [query.actorId, ...(query.actors?.split(',') || []).map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
actorIds: [query.actorId, ...(query.actors?.split(',') || []).map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
||||||
tagIds: await getIdsBySlug([query.tagSlug, ...(query.tags?.split(',') || [])], 'tags'),
|
tagIds: await getIdsBySlug([query.tagSlug, ...(query.tags?.split(',') || [])], 'tags'),
|
||||||
entityId: query.e ? await getIdsBySlug([query.e], 'entities').then(([id]) => id) : query.entityId,
|
entityId: query.e ? await getIdsBySlug([query.e], 'entities').then(([id]) => id) : query.entityId,
|
||||||
|
@ -20,7 +19,6 @@ export async function curateMoviesQuery(query) {
|
||||||
export async function fetchMoviesApi(req, res) {
|
export async function fetchMoviesApi(req, res) {
|
||||||
const {
|
const {
|
||||||
movies,
|
movies,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
@ -33,7 +31,6 @@ export async function fetchMoviesApi(req, res) {
|
||||||
|
|
||||||
res.send(stringify({
|
res.send(stringify({
|
||||||
movies,
|
movies,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
|
|
@ -7,7 +7,6 @@ import slugify from '../../utils/slugify.js';
|
||||||
import promiseProps from '../../utils/promise-props.js';
|
import promiseProps from '../../utils/promise-props.js';
|
||||||
|
|
||||||
export async function curateScenesQuery(query) {
|
export async function curateScenesQuery(query) {
|
||||||
const splitYears = query.years?.split(',') || [];
|
|
||||||
const splitTags = query.tags?.split(',') || [];
|
const splitTags = query.tags?.split(',') || [];
|
||||||
const splitActors = query.actors?.split(',') || [];
|
const splitActors = query.actors?.split(',') || [];
|
||||||
const splitEntities = query.e?.split(',') || [];
|
const splitEntities = query.e?.split(',') || [];
|
||||||
|
@ -28,7 +27,6 @@ export async function curateScenesQuery(query) {
|
||||||
return {
|
return {
|
||||||
scope: query.scope || 'latest',
|
scope: query.scope || 'latest',
|
||||||
query: query.q,
|
query: query.q,
|
||||||
years: splitYears.map((year) => Number(year)).filter(Boolean) || [],
|
|
||||||
actorIds: [query.actorId, ...splitActors.filter((actor) => actor.charAt(0) !== '!').map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
actorIds: [query.actorId, ...splitActors.filter((actor) => actor.charAt(0) !== '!').map((identifier) => parseActorIdentifier(identifier)?.id)].filter(Boolean),
|
||||||
notActorIds: splitActors.filter((actor) => actor.charAt(0) === '!').map((identifier) => parseActorIdentifier(identifier.slice(1))?.id).filter(Boolean),
|
notActorIds: splitActors.filter((actor) => actor.charAt(0) === '!').map((identifier) => parseActorIdentifier(identifier.slice(1))?.id).filter(Boolean),
|
||||||
tagIds,
|
tagIds,
|
||||||
|
@ -45,7 +43,6 @@ export async function curateScenesQuery(query) {
|
||||||
export async function fetchScenesApi(req, res) {
|
export async function fetchScenesApi(req, res) {
|
||||||
const {
|
const {
|
||||||
scenes,
|
scenes,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
@ -61,7 +58,6 @@ export async function fetchScenesApi(req, res) {
|
||||||
|
|
||||||
res.send(stringify({
|
res.send(stringify({
|
||||||
scenes,
|
scenes,
|
||||||
aggYears,
|
|
||||||
aggActors,
|
aggActors,
|
||||||
aggTags,
|
aggTags,
|
||||||
aggChannels,
|
aggChannels,
|
||||||
|
|
Loading…
Reference in New Issue