Compare commits
1 Commits
master
...
091b7bd119
Author | SHA1 | Date |
---|---|---|
boi12321 | 091b7bd119 |
|
@ -10,9 +10,6 @@ config/*
|
|||
!config/default.js
|
||||
assets/js/config/
|
||||
!assets/js/config/default.js
|
||||
/export*
|
||||
/stashes*
|
||||
/alerts*
|
||||
*.heapprofile
|
||||
*.heapsnapshot
|
||||
.vscode
|
||||
|
|
|
@ -65,7 +65,6 @@
|
|||
</a>
|
||||
|
||||
<ul class="bio nolist">
|
||||
<!-- probably not a good idea
|
||||
<li
|
||||
v-if="actor.realName"
|
||||
class="bio-item"
|
||||
|
@ -73,7 +72,6 @@
|
|||
<dfn class="bio-label"><Icon icon="vcard" />Real name</dfn>
|
||||
<span class="bio-value">{{ actor.realName }}</span>
|
||||
</li>
|
||||
-->
|
||||
|
||||
<li
|
||||
v-if="actor.dateOfBirth"
|
||||
|
@ -111,15 +109,6 @@
|
|||
>{{ actor.ageAtDeath }}</span></span>
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-if="actor.orientation"
|
||||
class="bio-item"
|
||||
>
|
||||
<dfn class="bio-label"><Icon icon="heart7" />Orientation</dfn>
|
||||
|
||||
<span class="orientation">{{ actor.orientation }}</span>
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-if="actor.origin"
|
||||
class="bio-item birth"
|
||||
|
@ -305,7 +294,7 @@
|
|||
class="description"
|
||||
>
|
||||
{{ description.text }}
|
||||
<RouterLink :to="`/${description.entity.type}/${description.entity.slug}`">
|
||||
<router-link :to="`/${description.entity.type}/${description.entity.slug}`">
|
||||
<img
|
||||
v-if="description.entity.type === 'network' || !description.entity.parent || description.entity.independent"
|
||||
:src="`/img/logos/${description.entity.slug}/thumbs/network.png`"
|
||||
|
@ -317,7 +306,7 @@
|
|||
:src="`/img/logos/${description.entity.parent.slug}/thumbs/${description.entity.slug}.png`"
|
||||
class="description-logo"
|
||||
>
|
||||
</RouterLink>
|
||||
</router-link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -391,8 +380,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import config from 'config';
|
||||
|
||||
import Pagination from '../pagination/pagination.vue';
|
||||
import FilterBar from '../filters/filter-bar.vue';
|
||||
import Releases from '../releases/releases.vue';
|
||||
|
@ -484,7 +471,7 @@ export default {
|
|||
releases: null,
|
||||
done: false,
|
||||
totalCount: 0,
|
||||
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
|
||||
limit: 20,
|
||||
pageTitle: null,
|
||||
bioExpanded: false,
|
||||
photosExpanded: false,
|
||||
|
@ -698,8 +685,7 @@ export default {
|
|||
|
||||
.ethnicity,
|
||||
.hair,
|
||||
.eyes,
|
||||
.orientation {
|
||||
.eyes {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<RouterLink
|
||||
<router-link
|
||||
:to="`/actor/${actor.id}/${actor.slug}`"
|
||||
:target="target"
|
||||
class="actor nolink"
|
||||
>
|
||||
<div class="avatar">
|
||||
|
@ -19,7 +18,7 @@
|
|||
</div>
|
||||
|
||||
<span class="name">{{ actor.name }}</span>
|
||||
</RouterLink>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -37,10 +36,6 @@ export default {
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
target: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
unstashActor,
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
/>
|
||||
</span>
|
||||
|
||||
<RouterLink
|
||||
:to="hasScrolled ? '' : { name: 'actor', params: { actorId: actor.id, actorSlug: actor.slug } }"
|
||||
<a
|
||||
class="avatar-container"
|
||||
@click="goToActor"
|
||||
>
|
||||
<img
|
||||
v-if="actor.avatar"
|
||||
|
@ -67,21 +67,21 @@
|
|||
v-show="(!stash || stash.primary) && favorited"
|
||||
icon="heart7"
|
||||
class="stash stashed"
|
||||
@click.stop.native="unstashActor"
|
||||
@click.prevent.native="unstashActor"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="(!stash || stash.primary) && favorited === false"
|
||||
icon="heart8"
|
||||
class="stash unstashed"
|
||||
@click.stop.native="stashActor"
|
||||
@click.prevent.native="stashActor"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="stash && !stash.primary"
|
||||
icon="cross2"
|
||||
class="stash unstash"
|
||||
@click.stop.native="unstashActor"
|
||||
@click.prevent.native="unstashActor"
|
||||
/>
|
||||
|
||||
<span class="details">
|
||||
|
@ -130,7 +130,7 @@
|
|||
class="country"
|
||||
/>
|
||||
</span>
|
||||
</RouterLink>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -138,6 +138,13 @@
|
|||
<script>
|
||||
import Gender from './gender.vue';
|
||||
|
||||
function goToActor() {
|
||||
// can't seem to control behavior with RouterLink
|
||||
if (!this.hasScrolled) {
|
||||
this.$router.push({ name: 'actor', params: { actorId: this.actor.id, actorSlug: this.actor.slug } });
|
||||
}
|
||||
}
|
||||
|
||||
async function stashActor() {
|
||||
this.favorited = true;
|
||||
|
||||
|
@ -208,6 +215,7 @@ export default {
|
|||
methods: {
|
||||
stashActor,
|
||||
unstashActor,
|
||||
goToActor,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -3,28 +3,13 @@
|
|||
title="Add alert"
|
||||
@close="$emit('close')"
|
||||
>
|
||||
<div
|
||||
v-if="error"
|
||||
class="dialog-error"
|
||||
>{{ error }}</div>
|
||||
|
||||
<form
|
||||
class="dialog-body"
|
||||
@submit.prevent="addAlert"
|
||||
>
|
||||
<div class="dialog-section">
|
||||
<h3 class="dialog-heading">
|
||||
When
|
||||
|
||||
<label class="dialog-description noselect">
|
||||
<template v-if="all">Scene must match <strong>all</strong> fields</template>
|
||||
<template v-else>Scene must match <strong>any</strong> field</template>
|
||||
|
||||
<Toggle
|
||||
:checked="all"
|
||||
@change="(checked) => all = checked"
|
||||
/>
|
||||
</label>
|
||||
When<span class="dialog-description">All to appear in the same scene</span>
|
||||
</h3>
|
||||
|
||||
<div class="alert-section">
|
||||
|
@ -44,10 +29,7 @@
|
|||
:key="`actor-${actor.id}`"
|
||||
class="actor"
|
||||
>
|
||||
<ActorPreview
|
||||
:actor="actor"
|
||||
target="_blank"
|
||||
/>
|
||||
<ActorPreview :actor="actor" />
|
||||
|
||||
<Icon
|
||||
icon="cross3"
|
||||
|
@ -122,15 +104,10 @@
|
|||
|
||||
<div class="entities">
|
||||
<div
|
||||
v-for="(entity, index) in entities"
|
||||
:key="`entity-${entity.id}`"
|
||||
:class="{ invalid: all && index > 0 }"
|
||||
v-if="entity"
|
||||
class="entity"
|
||||
>
|
||||
<Entity
|
||||
:entity="entity"
|
||||
target="_blank"
|
||||
/>
|
||||
<Entity :entity="entity" />
|
||||
|
||||
<Icon
|
||||
icon="cross3"
|
||||
|
@ -139,7 +116,7 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<Tooltip v-if="entities.length < 1 || !all">
|
||||
<Tooltip v-if="!entity">
|
||||
<div class="entity placeholder">
|
||||
Any channel
|
||||
|
||||
|
@ -159,72 +136,6 @@
|
|||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert-section">
|
||||
<h4 class="alert-heading">Matching</h4>
|
||||
|
||||
<ul class="matches nolist">
|
||||
<li
|
||||
v-for="(match, index) in matches"
|
||||
:key="`match-${index}`"
|
||||
class="match"
|
||||
>
|
||||
<span class="match-property">{{ match.property }}: </span>
|
||||
|
||||
<span
|
||||
v-if="match.expression.slice(0, 1) === '/' && match.expression.slice(-1) === '/'"
|
||||
class="match-expression"
|
||||
><span class="match-slash">/</span>{{ match.expression.slice(1, -1) }}<span class="match-slash">/</span></span>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="match-expression"
|
||||
>{{ match.expression }}</span>
|
||||
|
||||
<Icon
|
||||
icon="cross3"
|
||||
class="remove"
|
||||
@click.native="removeMatch(index)"
|
||||
/>
|
||||
</li>
|
||||
|
||||
<Tooltip
|
||||
v-if="!entity"
|
||||
@open="$refs.expression?.focus()"
|
||||
>
|
||||
<li class="match placeholder">
|
||||
Anything
|
||||
|
||||
<Icon
|
||||
icon="plus3"
|
||||
class="add"
|
||||
/>
|
||||
</li>
|
||||
|
||||
<template #tooltip>
|
||||
<form
|
||||
class="pattern-tooltip"
|
||||
@submit.prevent="addMatch"
|
||||
>
|
||||
<select
|
||||
v-model="matchProperty"
|
||||
class="input"
|
||||
>
|
||||
<option value="title">Title</option>
|
||||
<option value="description">Description</option>
|
||||
</select>
|
||||
|
||||
<input
|
||||
ref="expression"
|
||||
v-model="matchExpression"
|
||||
class="input"
|
||||
placeholder="Expression, // for RegExp"
|
||||
>
|
||||
</form>
|
||||
</template>
|
||||
</Tooltip>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dialog-section">
|
||||
|
@ -283,7 +194,7 @@
|
|||
|
||||
<div class="dialog-actions right">
|
||||
<button
|
||||
:disabled="actors.length === 0 && tags.length === 0 && !entity && matches.length === 0"
|
||||
:disabled="actors.length === 0 && tags.length === 0 && !entity"
|
||||
type="submit"
|
||||
class="button button-primary"
|
||||
>Add alert</button>
|
||||
|
@ -296,28 +207,19 @@
|
|||
import ActorPreview from '../actors/preview.vue';
|
||||
import Entity from '../entities/tile.vue';
|
||||
import Checkbox from '../form/checkbox.vue';
|
||||
import Toggle from '../form/toggle.vue';
|
||||
import Search from './search.vue';
|
||||
|
||||
async function addAlert() {
|
||||
this.error = null;
|
||||
|
||||
try {
|
||||
await this.$store.dispatch('addAlert', {
|
||||
all: this.all,
|
||||
actors: this.actors.map((actor) => actor.id),
|
||||
tags: this.tags.map((tag) => tag.id),
|
||||
matches: this.matches,
|
||||
entities: this.entities.map((entity) => entity.id),
|
||||
entity: this.entity?.id,
|
||||
notify: this.notify,
|
||||
email: this.email,
|
||||
stashes: this.stashes.map((stash) => stash.id),
|
||||
});
|
||||
|
||||
this.$emit('close', true);
|
||||
} catch (error) {
|
||||
this.error = error.message;
|
||||
}
|
||||
}
|
||||
|
||||
function addActor(actor) {
|
||||
|
@ -329,7 +231,7 @@ function addActor(actor) {
|
|||
}
|
||||
|
||||
function addEntity(entity) {
|
||||
this.entities = this.entities.concat(entity);
|
||||
this.entity = entity;
|
||||
this.events.emit('blur');
|
||||
}
|
||||
|
||||
|
@ -345,34 +247,14 @@ function removeActor(actor) {
|
|||
this.actors = this.actors.filter((listedActor) => listedActor.id !== actor.id);
|
||||
}
|
||||
|
||||
function removeEntity(entity) {
|
||||
this.entities = this.entities.filter((alertEntity) => alertEntity.id !== entity.id);
|
||||
function removeEntity() {
|
||||
this.entity = null;
|
||||
}
|
||||
|
||||
function removeTag(tag) {
|
||||
this.tags = this.tags.filter((listedTag) => listedTag.id !== tag.id);
|
||||
}
|
||||
|
||||
function addMatch() {
|
||||
if (!this.matchExpression) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.matches = this.matches.concat({
|
||||
property: this.matchProperty,
|
||||
expression: this.matchExpression,
|
||||
});
|
||||
|
||||
this.matchProperty = 'title';
|
||||
this.matchExpression = null;
|
||||
|
||||
this.events.emit('blur');
|
||||
}
|
||||
|
||||
function removeMatch(removeIndex) {
|
||||
this.matches = this.matches.filter((match, matchIndex) => matchIndex !== removeIndex);
|
||||
}
|
||||
|
||||
function addStash(stash) {
|
||||
if (!this.stashes.some((selectedStash) => selectedStash.id === stash.id)) {
|
||||
this.stashes = this.stashes.concat(stash);
|
||||
|
@ -391,19 +273,13 @@ export default {
|
|||
Checkbox,
|
||||
Entity,
|
||||
Search,
|
||||
Toggle,
|
||||
},
|
||||
emits: ['close'],
|
||||
data() {
|
||||
return {
|
||||
error: null,
|
||||
actors: [],
|
||||
tags: [],
|
||||
all: true,
|
||||
entities: [],
|
||||
matches: [],
|
||||
matchProperty: 'title',
|
||||
matchExpression: null,
|
||||
entity: null,
|
||||
notify: true,
|
||||
email: false,
|
||||
stashes: [],
|
||||
|
@ -414,12 +290,10 @@ export default {
|
|||
addActor,
|
||||
addAlert,
|
||||
addEntity,
|
||||
addMatch,
|
||||
addTag,
|
||||
addStash,
|
||||
removeActor,
|
||||
removeEntity,
|
||||
removeMatch,
|
||||
removeTag,
|
||||
removeStash,
|
||||
},
|
||||
|
@ -446,24 +320,9 @@ export default {
|
|||
}
|
||||
|
||||
.dialog-description {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--shadow);
|
||||
font-size: .9rem;
|
||||
font-weight: normal;
|
||||
|
||||
.toggle-container {
|
||||
margin-left: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-error {
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
background: var(--error);
|
||||
color: var(--text-light);
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.alert-heading {
|
||||
|
@ -479,34 +338,6 @@ export default {
|
|||
font-size: 0;
|
||||
}
|
||||
|
||||
.match {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: .25rem 0;
|
||||
font-family: inherit;
|
||||
|
||||
.remove {
|
||||
position: relative;
|
||||
top: -.1rem;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.match-property {
|
||||
text-transform: capitalize;
|
||||
color: var(--shadow);
|
||||
}
|
||||
|
||||
.match-expression {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.match-slash {
|
||||
padding: 0 .1rem;
|
||||
color: var(--primary);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.actors > .actor,
|
||||
.entity,
|
||||
.tag,
|
||||
|
@ -516,11 +347,6 @@ export default {
|
|||
margin: 0 .5rem .5rem 0;
|
||||
}
|
||||
|
||||
.entity.invalid {
|
||||
opacity: .5;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.entity .tile {
|
||||
width: 10rem;
|
||||
height: 2.5rem;
|
||||
|
@ -540,14 +366,6 @@ export default {
|
|||
color: var(--text);
|
||||
}
|
||||
|
||||
.pattern-tooltip {
|
||||
display: flex;
|
||||
gap: .5rem;
|
||||
position: relative;
|
||||
padding: .5rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.remove {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
|
|
|
@ -1,28 +1,21 @@
|
|||
<template>
|
||||
<iframe
|
||||
v-if="campaign?.banner?.type === 'html'"
|
||||
ref="iframe"
|
||||
:width="campaign.banner.width"
|
||||
:height="campaign.banner.height"
|
||||
:src="getSource(campaign)"
|
||||
scrolling="none"
|
||||
marginwidth="0"
|
||||
marginheight="0"
|
||||
class="campaign frame"
|
||||
data-umami-event="campaign-click"
|
||||
:data-umami-event-campaign-id="`${campaign.entity.slug}-${campaign.id}`"
|
||||
/>
|
||||
|
||||
<a
|
||||
v-else-if="campaign"
|
||||
v-if="campaign"
|
||||
:href="campaign.url || campaign.affiliate?.url"
|
||||
target="_blank"
|
||||
class="campaign"
|
||||
data-umami-event="campaign-click"
|
||||
:data-umami-event-campaign-id="`${campaign.entity.slug}-${campaign.id}`"
|
||||
>
|
||||
<img
|
||||
:src="getSource(campaign)"
|
||||
v-if="campaign.banner.entity.type === 'network' || !campaign.banner.entity.parent"
|
||||
:src="`/img/banners/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`"
|
||||
:width="campaign.banner.width"
|
||||
:height="campaign.banner.height"
|
||||
class="campaign-banner"
|
||||
>
|
||||
|
||||
<img
|
||||
v-if="campaign.banner.entity.type === 'channel' && campaign.banner.entity.parent?.type === 'network'"
|
||||
:src="`/img/banners/${campaign.banner.entity.parent.slug}/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`"
|
||||
:width="campaign.banner.width"
|
||||
:height="campaign.banner.height"
|
||||
class="campaign-banner"
|
||||
|
@ -44,11 +37,6 @@ function ratioFilter(banner) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (banner.type === 'html' && banner.width > window.innerWidth) {
|
||||
// usually non-scalable iframes
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.minRatio && banner.ratio < this.minRatio) {
|
||||
return false;
|
||||
}
|
||||
|
@ -60,18 +48,6 @@ function ratioFilter(banner) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function getSource(campaign) {
|
||||
if (campaign.banner.entity.type === 'network' || !campaign.banner.entity.parent) {
|
||||
return `/banners/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`;
|
||||
}
|
||||
|
||||
if (campaign.banner.entity.type === 'channel' && campaign.banner.entity.parent?.type === 'network') {
|
||||
return `/banners/${campaign.banner.entity.parent.slug}/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function entityCampaign() {
|
||||
const bannerCampaigns = this.entity.campaigns
|
||||
.concat(this.entity.children?.flatMap((child) => child.campaigns))
|
||||
|
@ -87,10 +63,6 @@ function entityCampaign() {
|
|||
return randomCampaign;
|
||||
}
|
||||
|
||||
if (this.allowGeneric) {
|
||||
return this.genericCampaign();
|
||||
}
|
||||
|
||||
this.$emit('campaign', null);
|
||||
|
||||
return null;
|
||||
|
@ -112,10 +84,6 @@ function tagCampaign() {
|
|||
return randomCampaign;
|
||||
}
|
||||
|
||||
if (this.allowGeneric) {
|
||||
return this.genericCampaign();
|
||||
}
|
||||
|
||||
this.$emit('campaign', null);
|
||||
|
||||
return null;
|
||||
|
@ -130,21 +98,7 @@ async function genericCampaign() {
|
|||
return randomCampaign;
|
||||
}
|
||||
|
||||
async function specificCampaign(campaignId) {
|
||||
const campaign = await this.$store.dispatch('fetchCampaign', campaignId);
|
||||
|
||||
this.campaign = campaign;
|
||||
this.$emit('campaign', campaign);
|
||||
|
||||
return campaign;
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
if (this.$route.query.campaign) {
|
||||
await this.specificCampaign(this.$route.query.campaign);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.entity) {
|
||||
await this.entityCampaign();
|
||||
return;
|
||||
|
@ -180,10 +134,6 @@ export default {
|
|||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
allowGeneric: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
maxRatio: {
|
||||
type: Number,
|
||||
default: null,
|
||||
|
@ -199,9 +149,7 @@ export default {
|
|||
methods: {
|
||||
entityCampaign,
|
||||
genericCampaign,
|
||||
getSource,
|
||||
ratioFilter,
|
||||
specificCampaign,
|
||||
tagCampaign,
|
||||
},
|
||||
};
|
||||
|
@ -209,29 +157,15 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.campaign {
|
||||
height: 100%;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.campaign-banner {
|
||||
height: auto;
|
||||
width: auto;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.frame-container {
|
||||
position: relative;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.frame-target {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -16,14 +16,7 @@
|
|||
<p
|
||||
v-if="config.showDisclaimer"
|
||||
class="disclaimer"
|
||||
v-html="config.disclaimer"
|
||||
/>
|
||||
|
||||
<p
|
||||
v-if="config.showAnnouncement"
|
||||
class="announcement"
|
||||
v-html="config.announcement"
|
||||
/>
|
||||
>{{ config.disclaimer }}</p>
|
||||
|
||||
<div
|
||||
ref="content"
|
||||
|
@ -96,29 +89,17 @@ function scrollToTop() {
|
|||
this.$refs.content.scrollTop = 0;
|
||||
}
|
||||
|
||||
function trackIframeCampaign() {
|
||||
// no way to capture clicks from an iframe directly
|
||||
if (window.umami && document.activeElement.tagName === 'IFRAME' && document.activeElement.dataset.umamiEvent === 'campaign-click') {
|
||||
window.umami.track('campaign-click', {
|
||||
'campaign-id': document.activeElement.dataset.umamiEventCampaignId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
document.addEventListener('click', this.blur);
|
||||
window.addEventListener('resize', this.resize);
|
||||
|
||||
this.events.on('toggleSettings', this.toggleSettings);
|
||||
this.events.on('toggleSidebar', this.toggleSidebar);
|
||||
|
||||
window.addEventListener('blur', this.trackIframeCampaign);
|
||||
}
|
||||
|
||||
function beforeUnmount() {
|
||||
document.removeEventListener('click', this.blur);
|
||||
window.removeEventListener('resize', this.resize);
|
||||
window.removeEventListener('blur', this.trackIframeCampaign);
|
||||
}
|
||||
|
||||
export default {
|
||||
|
@ -141,11 +122,10 @@ export default {
|
|||
mounted,
|
||||
beforeUnmount,
|
||||
methods: {
|
||||
setConsent,
|
||||
toggleSidebar,
|
||||
toggleFilters,
|
||||
toggleSettings,
|
||||
trackIframeCampaign,
|
||||
setConsent,
|
||||
blur,
|
||||
resize,
|
||||
scroll,
|
||||
|
@ -214,21 +194,13 @@ export default {
|
|||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.disclaimer,
|
||||
.announcement {
|
||||
.disclaimer {
|
||||
padding: .5rem 1rem;
|
||||
margin: 0;
|
||||
color: var(--text-light);
|
||||
background: var(--warn);
|
||||
font-weight: bold;
|
||||
box-shadow: inset 0 0 3px var(--darken-weak);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.disclaimer {
|
||||
background: var(--warn);
|
||||
}
|
||||
|
||||
.announcement {
|
||||
background: var(--notice);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -96,10 +96,7 @@
|
|||
/>
|
||||
</Scroll>
|
||||
|
||||
<div
|
||||
v-if="config.campaigns.entity"
|
||||
class="campaign-container"
|
||||
>
|
||||
<div class="campaign-container">
|
||||
<Campaign
|
||||
:entity="entity"
|
||||
:min-ratio="3"
|
||||
|
@ -117,7 +114,6 @@
|
|||
<div class="releases">
|
||||
<Releases
|
||||
:releases="entity.releases"
|
||||
:entity="entity"
|
||||
:done="done"
|
||||
/>
|
||||
|
||||
|
@ -134,8 +130,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import config from 'config';
|
||||
|
||||
import FilterBar from '../filters/filter-bar.vue';
|
||||
import Pagination from '../pagination/pagination.vue';
|
||||
import Releases from '../releases/releases.vue';
|
||||
|
@ -163,17 +157,12 @@ async function fetchEntity(scroll = true) {
|
|||
const campaign = entity.campaigns.find((campaignX) => !campaignX.banner)
|
||||
|| entity.parent?.campaigns.find((campaignX) => !campaignX.banner);
|
||||
|
||||
if (entity.url) {
|
||||
const { searchParams, pathname, origin } = new URL(entity.url);
|
||||
|
||||
const affiliateParams = new URLSearchParams({
|
||||
...(entity.url && Object.fromEntries(searchParams)), // preserve any query in entity URL, e.g. ?siteId=5
|
||||
...(entity.url && Object.fromEntries(new URL(entity.url).searchParams)), // preserve any query in entity URL, e.g. ?siteId=5
|
||||
...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters
|
||||
}).toString();
|
||||
|
||||
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
|
||||
}
|
||||
|
||||
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${entity.url}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
|
||||
this.done = true;
|
||||
|
||||
if (scroll && this.$refs.filter?.$el) {
|
||||
|
@ -207,7 +196,7 @@ export default {
|
|||
pageTitle: null,
|
||||
totalCount: null,
|
||||
done: false,
|
||||
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
|
||||
limit: Number(this.$route.query.limit) || 20,
|
||||
expanded: false,
|
||||
entityUrl: null,
|
||||
};
|
||||
|
@ -297,7 +286,6 @@ export default {
|
|||
}
|
||||
|
||||
.campaign-container {
|
||||
max-height: 150px;
|
||||
background: var(--background-dim);
|
||||
text-align: center;
|
||||
padding: .5rem;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<template>
|
||||
<RouterLink
|
||||
<router-link
|
||||
:to="`/${entity.type}/${entity.slug}`"
|
||||
:title="entity.name"
|
||||
:target="target"
|
||||
class="tile"
|
||||
>
|
||||
<div class="tile-logo">
|
||||
|
@ -48,7 +47,7 @@
|
|||
<span v-if="typeof entity.sceneTotal !== 'undefined'">{{ entity.sceneTotal }} scenes</span>
|
||||
<span v-if="entity.type === 'network'">{{ entity.childrenTotal }} channels</span>
|
||||
</span>
|
||||
</RouterLink>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
@ -58,10 +57,6 @@ export default {
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
target: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
emits: ['load'],
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
<RouterLink
|
||||
v-if="me && favorites"
|
||||
:to="{ name: 'stash', params: { stashId: favorites.id, stashSlug: favorites.slug, username: me.username, range: 'scenes', pageNumber: 1 } }"
|
||||
:to="{ name: 'stash', params: { stashId: favorites.id, range: 'scenes', pageNumber: 1 } }"
|
||||
class="menu-item"
|
||||
><Icon icon="heart7" />Favorites</RouterLink>
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
|
||||
<Icon
|
||||
v-if="notification.alert"
|
||||
v-tooltip="`You set an alert for scenes with <strong>${notification.alert.all ? 'all of' : 'any of'}</strong> <strong>${notification.alert.actors.map(actor => actor.name).join(', ') || 'any actor'}</strong> containing <strong>${notification.alert.tags.map(tag => tag.name).join(', ') || 'any tags'}</strong> from <strong>${notification.alert.entities.map((entity) => entity.name).join(', ') || 'any channel'}</strong> matching <strong>${notification.alert.matches.map((match) => `${match.property}: ${match.expression}`).join(', ') || 'any text'}</strong>`"
|
||||
v-tooltip="`You set an alert for <strong>${notification.alert.tags.map(tag => tag.name).join(', ') || 'all'}</strong> scenes with <strong>${notification.alert.actors.map(actor => actor.name).join(', ') || 'any actor'}</strong> for <strong>${notification.alert.entity?.name || 'any channel'}</strong>`"
|
||||
icon="question5"
|
||||
@click.prevent.stop
|
||||
/>
|
||||
|
@ -145,12 +145,12 @@ export default {
|
|||
default: 0,
|
||||
},
|
||||
},
|
||||
emits: ['addAlert'],
|
||||
data() {
|
||||
return {
|
||||
showAddAlert: false,
|
||||
};
|
||||
},
|
||||
emits: ['addAlert'],
|
||||
methods: {
|
||||
checkNotifications,
|
||||
checkNotification,
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
<template>
|
||||
<div class="home">
|
||||
<div class="content-inner">
|
||||
<div
|
||||
v-if="config.campaigns.home"
|
||||
class="campaign-container"
|
||||
>
|
||||
<div class="campaign-container">
|
||||
<Campaign
|
||||
:min-ratio="6"
|
||||
/>
|
||||
|
@ -38,8 +35,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import config from 'config';
|
||||
|
||||
import FilterBar from '../filters/filter-bar.vue';
|
||||
import Releases from '../releases/releases.vue';
|
||||
import Pagination from '../pagination/pagination.vue';
|
||||
|
@ -81,7 +76,7 @@ export default {
|
|||
releases: [],
|
||||
networks: [],
|
||||
pageTitle: null,
|
||||
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
|
||||
limit: 30,
|
||||
totalCount: 0,
|
||||
from: null,
|
||||
done: false,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div
|
||||
:class="{ active }"
|
||||
:title="title"
|
||||
class="icon"
|
||||
v-html="svg"
|
||||
/>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="media-container">
|
||||
<div
|
||||
class="media"
|
||||
:class="{ center: (release.photos?.length || 0) + (release.caps?.length || 0) + (release.scenesPhotos?.length || 0) < 2, preview: !me }"
|
||||
:class="{ center: (release.photos?.length || 0) + (release.scenesPhotos?.length || 0) < 2, preview: !me }"
|
||||
>
|
||||
<div
|
||||
v-if="release.trailer || release.teaser"
|
||||
|
@ -169,10 +169,9 @@ function photos() {
|
|||
const clips = this.release.clips || [];
|
||||
const clipPostersById = clips.reduce((acc, clip) => ({ ...acc, [clip.poster.id]: clip.poster }), {});
|
||||
const uniqueClipPosters = Array.from(new Set(clips.map((clip) => clip.poster.id) || [])).map((posterId) => clipPostersById[posterId]);
|
||||
const photosWithClipPosters = (this.release.photos || []).concat(this.release.caps || []).concat(this.release.scenesPhotos || []).concat(uniqueClipPosters);
|
||||
const photosWithClipPosters = (this.release.photos || []).concat(this.release.scenesPhotos || []).concat(uniqueClipPosters);
|
||||
|
||||
if (this.release.trailer || (this.release.teaser && this.release.teaser.mime !== 'image/gif')) {
|
||||
// if (this.release.trailer) {
|
||||
// poster will be on trailer video
|
||||
return photosWithClipPosters;
|
||||
}
|
||||
|
|
|
@ -21,24 +21,21 @@
|
|||
<Details :release="release" />
|
||||
|
||||
<button
|
||||
v-if="showAlbum"
|
||||
v-if="release.photos?.length > 0 || release.scenesPhotos?.length > 0"
|
||||
class="album-toggle"
|
||||
@click="$router.push({ hash: '#album' })"
|
||||
><Icon icon="grid3" />View album</button>
|
||||
|
||||
<Album
|
||||
v-if="showAlbum && $route.hash === '#album'"
|
||||
:items="[release.poster, ...(release.photos || []), ...(release.caps || []), ...(release.scenesPhotos || [])]"
|
||||
v-if="showAlbum"
|
||||
:items="[release.poster, ...(release.photos || []), ...(release.scenesPhotos || [])]"
|
||||
:title="release.title"
|
||||
:path="config.media.mediaPath"
|
||||
@close="$router.replace({ hash: undefined })"
|
||||
/>
|
||||
|
||||
<div class="info column">
|
||||
<div
|
||||
class="row row-title"
|
||||
:class="{ 'has-alt': release.altTitles?.length > 0 }"
|
||||
>
|
||||
<div class="row row-title">
|
||||
<h2
|
||||
v-if="release.title"
|
||||
class="title"
|
||||
|
@ -65,24 +62,6 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="release.altTitles?.length > 0"
|
||||
class="row alttitles"
|
||||
>
|
||||
<h2
|
||||
v-for="(altTitle, index) in release.altTitles"
|
||||
:key="`altitle-${index}`"
|
||||
class="alttitle"
|
||||
>
|
||||
{{ altTitle }}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<Releases
|
||||
v-if="release.scenes && release.scenes.length > 0"
|
||||
:releases="release.scenes"
|
||||
/>
|
||||
|
||||
<div class="row associations">
|
||||
<ul
|
||||
ref="actors"
|
||||
|
@ -130,6 +109,11 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Releases
|
||||
v-if="release.scenes && release.scenes.length > 0"
|
||||
:releases="release.scenes"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="release.directors && release.directors.length > 0"
|
||||
class="row"
|
||||
|
@ -171,14 +155,6 @@
|
|||
<div class="duration">{{ formatDuration(release.duration) }}</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="release.photoCount"
|
||||
class="row-tidbit"
|
||||
>
|
||||
<span class="row-label">Photos</span>
|
||||
{{ release.photoCount }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="release.shootId"
|
||||
class="row-tidbit"
|
||||
|
@ -191,13 +167,7 @@
|
|||
v-if="release.studio"
|
||||
class="row-tidbit"
|
||||
>
|
||||
<span class="row-label">Studio
|
||||
<Icon
|
||||
v-if="release.studio.showcased === false"
|
||||
icon="eye-blocked"
|
||||
title="This studio does not appear on main pages"
|
||||
/>
|
||||
</span>
|
||||
<span class="row-label">Studio</span>
|
||||
|
||||
<RouterLink
|
||||
:to="`/studio/${release.studio.slug}`"
|
||||
|
@ -415,7 +385,7 @@ function pageTitle() {
|
|||
}
|
||||
|
||||
function showAlbum() {
|
||||
return this.release.photos?.length > 0 || this.release.caps?.length > 0 || this.release.scenesPhotos?.length > 0;
|
||||
return (this.release.photos?.length > 0 || this.release.scenesPhotos?.length > 0) && this.$route.hash === '#album';
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
|
@ -501,14 +471,13 @@ export default {
|
|||
}
|
||||
|
||||
.row-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
display: block;
|
||||
margin: 0 0 .5rem 0;
|
||||
color: var(--shadow);
|
||||
font-weight: bold;
|
||||
|
||||
.icon {
|
||||
margin: 0 .5rem;
|
||||
margin: 0 .5rem 0 0;
|
||||
fill: var(--shadow);
|
||||
}
|
||||
}
|
||||
|
@ -544,11 +513,6 @@ export default {
|
|||
color: var(--shadow);
|
||||
}
|
||||
|
||||
.alttitle {
|
||||
color: var(--shadow);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.album-toggle {
|
||||
height: fit-content;
|
||||
display: inline-flex;
|
||||
|
|
|
@ -12,34 +12,18 @@
|
|||
:key="sfw"
|
||||
class="nolist tiles"
|
||||
>
|
||||
<template v-for="(item, index) in items">
|
||||
<li
|
||||
v-if="item === 'campaign'"
|
||||
:key="`campaign-${index}`"
|
||||
class="campaign"
|
||||
>
|
||||
<Campaign
|
||||
v-if="item === 'campaign'"
|
||||
:entity="entity"
|
||||
:min-ratio="0.75"
|
||||
:max-ratio="1.25"
|
||||
:allow-generic="true"
|
||||
/>
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-else
|
||||
:key="`release-${item.id}`"
|
||||
v-for="(release, index) in releases"
|
||||
:key="`release-${release.id}`"
|
||||
>
|
||||
<SceneTile
|
||||
:release="item"
|
||||
:release="release"
|
||||
:referer="referer"
|
||||
:index="index"
|
||||
:stash="stash"
|
||||
@stash="isStashed => $emit('stash', isStashed)"
|
||||
/>
|
||||
</li>
|
||||
</template>
|
||||
</ul>
|
||||
|
||||
<span
|
||||
|
@ -54,36 +38,28 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import config from 'config';
|
||||
|
||||
import {
|
||||
defineProps,
|
||||
defineEmits,
|
||||
computed,
|
||||
} from 'vue';
|
||||
|
||||
import { useStore } from 'vuex';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import Campaign from '../campaigns/campaign.vue';
|
||||
<script>
|
||||
import Ellipsis from '../loading/ellipsis.vue';
|
||||
import SceneTile from './scene-tile.vue';
|
||||
|
||||
const router = useRouter();
|
||||
const store = useStore();
|
||||
function range() {
|
||||
return this.$route.params.range;
|
||||
}
|
||||
|
||||
defineEmits(['stash']);
|
||||
function sfw() {
|
||||
return this.$store.state.ui.sfw;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
export default {
|
||||
components: {
|
||||
Ellipsis,
|
||||
SceneTile,
|
||||
},
|
||||
props: {
|
||||
releases: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
entity: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
context: {
|
||||
type: String,
|
||||
default: null,
|
||||
|
@ -100,14 +76,13 @@ const props = defineProps({
|
|||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const campaignIndex = computed(() => Math.floor(Math.random() * props.releases.length - 5) + 5);
|
||||
|
||||
const items = computed(() => props.releases.flatMap((release, index) => (config.campaigns.tiles && props.releases.length > 10 && index === campaignIndex.value ? ['campaign', release] : release)));
|
||||
|
||||
const range = computed(() => router.route?.params.range);
|
||||
const sfw = computed(() => store.state.ui.sfw);
|
||||
},
|
||||
emits: ['stash'],
|
||||
computed: {
|
||||
range,
|
||||
sfw,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -151,12 +126,6 @@ const sfw = computed(() => store.state.ui.sfw);
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.campaign {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
@media(max-width: $breakpoint-mega) {
|
||||
.tiles {
|
||||
grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
|
||||
|
|
|
@ -100,7 +100,10 @@
|
|||
>{{ release.entity.name }}</h3>
|
||||
</a>
|
||||
|
||||
<span class="row">
|
||||
<span
|
||||
v-if="release.actors?.length > 0"
|
||||
class="row"
|
||||
>
|
||||
<ul
|
||||
class="actors nolist"
|
||||
:title="release.actors.map(actor => actor.name).join(', ')"
|
||||
|
@ -354,9 +357,9 @@ export default {
|
|||
}
|
||||
|
||||
.actors {
|
||||
height: 1.5rem;
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
max-height: 1.5rem;
|
||||
line-height: 1.5rem;
|
||||
margin: 0 0 .25rem 0;
|
||||
}
|
||||
|
|
|
@ -28,12 +28,7 @@
|
|||
</template>
|
||||
|
||||
<span
|
||||
v-if="error"
|
||||
class="error summary"
|
||||
>{{ error }}</span>
|
||||
|
||||
<span
|
||||
v-else-if="!loading && actors.length === 0 && releases.length === 0"
|
||||
v-if="!loading && actors.length === 0 && releases.length === 0"
|
||||
class="summary"
|
||||
>No results</span>
|
||||
</div>
|
||||
|
@ -44,7 +39,6 @@ import Actor from '../actors/tile.vue';
|
|||
import Releases from '../releases/releases.vue';
|
||||
|
||||
async function search() {
|
||||
try {
|
||||
const results = await this.$store.dispatch('search', {
|
||||
query: this.query,
|
||||
limit: 10,
|
||||
|
@ -56,12 +50,6 @@ async function search() {
|
|||
this.actors = results.actors;
|
||||
this.releases = results.releases;
|
||||
}
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
this.error = 'Failed to retrieve search results, sorry about that.';
|
||||
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
function query() {
|
||||
|
@ -113,10 +101,6 @@ export default {
|
|||
margin: 0 0 1rem 0;
|
||||
color: var(--shadow);
|
||||
font-weight: bold;
|
||||
|
||||
&.error {
|
||||
color: var(--error);
|
||||
}
|
||||
}
|
||||
|
||||
.tiles {
|
||||
|
|
|
@ -42,7 +42,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
tags: ['gay', 'transsexual', 'bisexual', 'anal', 'anal prolapse', 'pissing'],
|
||||
tags: ['anal', 'gay', 'transsexual', 'bisexual', 'pissing', 'anal prolapse'],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -7,11 +7,6 @@
|
|||
class="dialog-body"
|
||||
@submit.prevent="addStash"
|
||||
>
|
||||
<div
|
||||
v-if="errorMsg"
|
||||
class="form-error"
|
||||
>{{ errorMsg }}</div>
|
||||
|
||||
<input
|
||||
ref="name"
|
||||
v-model="name"
|
||||
|
@ -32,17 +27,11 @@
|
|||
|
||||
<script>
|
||||
async function addStash() {
|
||||
this.errorMsg = null;
|
||||
|
||||
try {
|
||||
await this.$store.dispatch('createStash', {
|
||||
name: this.name,
|
||||
});
|
||||
|
||||
this.$emit('close', true);
|
||||
} catch (error) {
|
||||
this.errorMsg = error.message;
|
||||
}
|
||||
}
|
||||
|
||||
function mounted() {
|
||||
|
@ -50,22 +39,15 @@ function mounted() {
|
|||
}
|
||||
|
||||
export default {
|
||||
emits: ['close'],
|
||||
data() {
|
||||
return {
|
||||
errorMsg: null,
|
||||
name: null,
|
||||
};
|
||||
},
|
||||
emits: ['close'],
|
||||
mounted,
|
||||
methods: {
|
||||
addStash,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.input {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -115,8 +115,6 @@ import Pagination from '../pagination/pagination.vue';
|
|||
async function fetchStash() {
|
||||
this.stash = await this.$store.dispatch('fetchStash', {
|
||||
stashId: this.$route.params.stashId,
|
||||
stashSlug: this.$route.params.stashSlug,
|
||||
username: this.$route.params.username,
|
||||
section: this.$route.params.range,
|
||||
pageNumber: this.$route.params.pageNumber || 1,
|
||||
limit: this.limit,
|
||||
|
|
|
@ -8,84 +8,71 @@
|
|||
<dt class="stat-label">Version</dt>
|
||||
<dd class="stat-value">{{ version }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<template v-if="loaded">
|
||||
<dl class="stat-table">
|
||||
<div class="stat-row">
|
||||
<dt class="stat-label">Content updated</dt>
|
||||
<dd
|
||||
class="stat-value"
|
||||
:title="format(lastScrape, 'yyyy-MM-dd HH:mm')"
|
||||
>{{ formatDistance(lastScrape, new Date(), { includeSeconds: true }) }} ago</dd>
|
||||
<dd class="stat-value">{{ formatDate(lastScrape, 'YYYY-MM-DD HH:mm') }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<dl class="stat-table">
|
||||
<div class="stat-row">
|
||||
<dt class="stat-label">Networks</dt>
|
||||
<dd class="stat-value">{{ totalNetworks.toLocaleString() }}</dd>
|
||||
<dd class="stat-value">{{ totalNetworks }}</dd>
|
||||
</div>
|
||||
|
||||
<div class="stat-row">
|
||||
<dt class="stat-label">Channels</dt>
|
||||
<dd class="stat-value">{{ totalChannels.toLocaleString() }}</dd>
|
||||
<dd class="stat-value">{{ totalChannels }}</dd>
|
||||
</div>
|
||||
|
||||
<div class="stat-row">
|
||||
<dt class="stat-label">Scenes</dt>
|
||||
<dd class="stat-value">{{ totalScenes.toLocaleString() }}</dd>
|
||||
<dd class="stat-value">{{ totalScenes }}</dd>
|
||||
</div>
|
||||
|
||||
<div class="stat-row">
|
||||
<dt class="stat-label">Movies</dt>
|
||||
<dd class="stat-value">{{ totalMovies.toLocaleString() }}</dd>
|
||||
<dd class="stat-value">{{ totalMovies }}</dd>
|
||||
</div>
|
||||
|
||||
<div class="stat-row">
|
||||
<dt class="stat-label">Actors</dt>
|
||||
<dd class="stat-value">{{ totalActors.toLocaleString() }}</dd>
|
||||
<dd class="stat-value">{{ totalActors }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</template>
|
||||
|
||||
<Ellipsis v-else />
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useStore } from 'vuex';
|
||||
import { format, formatDistance } from 'date-fns';
|
||||
<script>
|
||||
async function mounted() {
|
||||
const stats = await this.$store.dispatch('fetchStats');
|
||||
|
||||
import Ellipsis from '../loading/ellipsis.vue';
|
||||
this.totalScenes = stats.totalScenes;
|
||||
this.totalMovies = stats.totalMovies;
|
||||
this.totalActors = stats.totalActors;
|
||||
this.totalNetworks = stats.totalNetworks;
|
||||
this.totalChannels = stats.totalChannels;
|
||||
this.lastScrape = stats.lastScrape;
|
||||
|
||||
const store = useStore();
|
||||
const version = VERSION; // eslint-disable-line no-undef
|
||||
this.version = VERSION; // eslint-disable-line no-undef
|
||||
}
|
||||
|
||||
const loaded = ref(false);
|
||||
const totalScenes = ref(0);
|
||||
const totalMovies = ref(0);
|
||||
const totalActors = ref(0);
|
||||
const totalNetworks = ref(0);
|
||||
const totalChannels = ref(0);
|
||||
const lastScrape = ref(null);
|
||||
|
||||
onMounted(async () => {
|
||||
const stats = await store.dispatch('fetchStats');
|
||||
|
||||
totalScenes.value = stats.totalScenes;
|
||||
totalMovies.value = stats.totalMovies;
|
||||
totalActors.value = stats.totalActors;
|
||||
totalNetworks.value = stats.totalNetworks;
|
||||
totalChannels.value = stats.totalChannels;
|
||||
lastScrape.value = stats.lastScrape;
|
||||
|
||||
loaded.value = true;
|
||||
});
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
totalScenes: 0,
|
||||
totalMovies: 0,
|
||||
totalActors: 0,
|
||||
totalNetworks: 0,
|
||||
totalChannels: 0,
|
||||
};
|
||||
},
|
||||
mounted,
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -49,11 +49,11 @@ import Campaign from '../campaigns/campaign.vue';
|
|||
|
||||
function photos() {
|
||||
if (this.tag.poster && this.$store.state.ui.sfw) {
|
||||
return [this.tag.poster].concat(this.tag.photos).map((photo) => photo.sfw);
|
||||
return [this.tag.poster].concat(this.tag.photos).map(photo => photo.sfw);
|
||||
}
|
||||
|
||||
if (this.$store.state.ui.sfw) {
|
||||
return this.tag.photos.map((photo) => photo.sfw);
|
||||
return this.tag.photos.map(photo => photo.sfw);
|
||||
}
|
||||
|
||||
if (this.tag.poster) {
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import config from 'config';
|
||||
import { Converter } from 'showdown';
|
||||
|
||||
import escapeHtml from '../../../src/utils/escape-html';
|
||||
|
@ -156,7 +155,7 @@ export default {
|
|||
releases: null,
|
||||
done: false,
|
||||
totalCount: 0,
|
||||
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
|
||||
limit: 20,
|
||||
pageTitle: null,
|
||||
hasMedia: false,
|
||||
expanded: false,
|
||||
|
|
|
@ -125,7 +125,6 @@ function mounted() {
|
|||
}
|
||||
|
||||
export default {
|
||||
emits: ['open', 'close'],
|
||||
data() {
|
||||
return {
|
||||
opened: false,
|
||||
|
@ -134,6 +133,7 @@ export default {
|
|||
arrowOffset: 0,
|
||||
};
|
||||
},
|
||||
emits: ['open', 'close'],
|
||||
mounted,
|
||||
methods: {
|
||||
calculate,
|
||||
|
|
|
@ -93,43 +93,17 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
v-if="alert.entities.length > 0"
|
||||
v-if="alert.entity"
|
||||
class="alert-section alert-trigger"
|
||||
>
|
||||
<h4 class="alert-heading">{{ alert.entities.length > 1 ? 'Channels' : 'Channel' }}</h4>
|
||||
<h4 class="alert-heading">Channel</h4>
|
||||
|
||||
<Entity
|
||||
v-for="entity in alert.entities"
|
||||
:key="`${alert.id}${entity.id}`"
|
||||
:entity="entity"
|
||||
v-if="alert.entity"
|
||||
:entity="alert.entity"
|
||||
class="entity"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="alert.matches.length > 0"
|
||||
class="alert-section alert-trigger"
|
||||
>
|
||||
<h4 class="alert-heading">Matches</h4>
|
||||
|
||||
<ul class="alert-matches nolist">
|
||||
<li
|
||||
v-for="match in alert.matches"
|
||||
:key="`match-${match.id}`"
|
||||
class="match"
|
||||
>
|
||||
<span
|
||||
v-if="match.expression.slice(0, 1) === '/' && match.expression.slice(-1) === '/'"
|
||||
class="match-expression"
|
||||
><span class="match-slash">/</span>{{ match.expression.slice(1, -1) }}<span class="match-slash">/</span></span>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="match-expression"
|
||||
>{{ match.expression }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -253,34 +227,26 @@ export default {
|
|||
}
|
||||
|
||||
.alert-actors,
|
||||
.alert-tags,
|
||||
.alert-matches {
|
||||
.alert-tags {
|
||||
display: flex;
|
||||
grid-gap: .5rem;
|
||||
}
|
||||
|
||||
.tag,
|
||||
.match {
|
||||
.tag {
|
||||
color: var(--shadow-strong);
|
||||
padding: .5rem;
|
||||
border: solid 1px var(--shadow-hint);
|
||||
font-size: .9rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tag:hover {
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
.entity {
|
||||
width: 10rem;
|
||||
height: 2.5rem;
|
||||
}
|
||||
|
||||
.match-slash {
|
||||
padding: 0 .1rem;
|
||||
color: var(--primary);
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<div class="stash">
|
||||
<div class="stash-section stash-header">
|
||||
<RouterLink
|
||||
<router-link
|
||||
:to="{ name: 'stash', params: { stashId: stash.id, stashSlug: stash.slug, range: 'scenes', pageNumber: 1 } }"
|
||||
class="stash-link nolink"
|
||||
>
|
||||
<h4 class="stash-name">{{ stash.name }}</h4>
|
||||
<span class="stash-more">Browse</span>
|
||||
</RouterLink>
|
||||
</router-link>
|
||||
|
||||
<span class="header-actions noselect">
|
||||
<label
|
||||
|
|
|
@ -14,13 +14,11 @@
|
|||
<div class="section-header">
|
||||
<h3 class="section-heading">Stashes</h3>
|
||||
|
||||
<button
|
||||
v-if="isMe"
|
||||
class="button button-secondary header-add"
|
||||
<Icon
|
||||
icon="plus3"
|
||||
class="header-add"
|
||||
@click="showAddStash = true"
|
||||
>
|
||||
<Icon icon="plus3" />Add stash
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ul class="section-body stashes nolist">
|
||||
|
@ -37,7 +35,6 @@
|
|||
/>
|
||||
</li>
|
||||
|
||||
<!--
|
||||
<li
|
||||
v-if="isMe"
|
||||
class="stashes-stash stashes-add"
|
||||
|
@ -45,7 +42,6 @@
|
|||
>
|
||||
<Icon icon="plus2" />
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
|
||||
<AddStash
|
||||
|
@ -58,13 +54,11 @@
|
|||
<div class="section-header">
|
||||
<h3 class="section-heading">Alerts</h3>
|
||||
|
||||
<button
|
||||
v-if="isMe"
|
||||
class="button button-secondary header-add"
|
||||
<Icon
|
||||
icon="plus3"
|
||||
class="header-add"
|
||||
@click="showAddAlert = true"
|
||||
>
|
||||
<Icon icon="plus3" />Set alert
|
||||
</button>
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ul class="section-body alerts nolist">
|
||||
|
@ -80,14 +74,12 @@
|
|||
/>
|
||||
</li>
|
||||
|
||||
<!--
|
||||
<li
|
||||
class="alerts-add"
|
||||
@click="showAddAlert = true"
|
||||
>
|
||||
<Icon icon="plus2" />
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
|
||||
<AddAlert
|
||||
|
@ -194,7 +186,7 @@ export default {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 0 1rem 1rem 0;
|
||||
margin: 0 0 1rem 0;
|
||||
}
|
||||
|
||||
.section-body {
|
||||
|
@ -209,6 +201,14 @@ export default {
|
|||
}
|
||||
|
||||
.header-add {
|
||||
height: auto;
|
||||
padding: .5rem 1rem;
|
||||
fill: var(--shadow);
|
||||
|
||||
&:hover {
|
||||
fill: var(--primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.stashes-stash {
|
||||
|
|
|
@ -3,11 +3,3 @@
|
|||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.form-error {
|
||||
padding: .5rem;
|
||||
margin-bottom: .5rem;
|
||||
color: var(--text-light);
|
||||
background: var(--error);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -26,9 +26,6 @@
|
|||
}
|
||||
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
background: none;
|
||||
padding: .5rem;
|
||||
|
@ -52,11 +49,6 @@
|
|||
background: var(--shadow-weak);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon {
|
||||
fill: var(--text-light);
|
||||
margin-right: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.button-secondary {
|
||||
|
@ -65,21 +57,12 @@
|
|||
&:hover:not(:disabled) {
|
||||
color: var(--text-light);
|
||||
background: var(--primary);
|
||||
|
||||
.icon {
|
||||
fill: var(--text-light);
|
||||
}
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
color: var(--shadow-strong);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon {
|
||||
fill: var(--primary);
|
||||
margin-right: .5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.album-toggle {
|
||||
|
|
|
@ -52,10 +52,9 @@ $breakpoint4: 1500px;
|
|||
--female: #f0a;
|
||||
|
||||
--alert: #f00;
|
||||
--error: #fd5555;
|
||||
--error: #f00;
|
||||
--warn: #fa0;
|
||||
--success: #5c2;
|
||||
--notice: #25c;
|
||||
|
||||
--enabled: #5c2;
|
||||
--enabled-background: rgba(0, 255, 0, .1);
|
||||
|
|
|
@ -18,10 +18,6 @@
|
|||
<link rel="stylesheet" href="/css/style.css">
|
||||
|
||||
<script src="/js/bundle.js" defer></script>
|
||||
|
||||
<% if (analytics.enabled) { %>
|
||||
<script async src="<%- analytics.address %>" data-website-id="<%- analytics.siteId %>"></script>
|
||||
<% } %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container"></div>
|
||||
|
|
|
@ -10,7 +10,6 @@ import {
|
|||
actorStashesFields,
|
||||
getIncludedEntities,
|
||||
getIncludedActors,
|
||||
batchFragment,
|
||||
} from '../fragments';
|
||||
|
||||
function initActorActions(store, router) {
|
||||
|
@ -28,7 +27,7 @@ function initActorActions(store, router) {
|
|||
const includedTags = router.currentRoute.value.query.tags ? router.currentRoute.value.query.tags.split(',') : [];
|
||||
const mode = router.currentRoute.value.query.mode || 'all';
|
||||
|
||||
const { actor, batches: [lastBatch] } = await graphql(`
|
||||
const { actor } = await graphql(`
|
||||
query Actor(
|
||||
$actorId: Int!
|
||||
$userId: Int,
|
||||
|
@ -37,6 +36,8 @@ function initActorActions(store, router) {
|
|||
$offset:Int = 0,
|
||||
$after:Datetime = "1900-01-01",
|
||||
$before:Datetime = "2100-01-01",
|
||||
$afterTime:Datetime = "1900-01-01",
|
||||
$beforeTime:Datetime = "2100-01-01",
|
||||
$orderBy:[ReleasesOrderBy!]
|
||||
$selectableTags: [String],
|
||||
$includedTags: [String!],
|
||||
|
@ -51,7 +52,6 @@ function initActorActions(store, router) {
|
|||
slug
|
||||
realName
|
||||
gender
|
||||
orientation
|
||||
dateOfBirth
|
||||
dateOfDeath
|
||||
age
|
||||
|
@ -204,10 +204,23 @@ function initActorActions(store, router) {
|
|||
}
|
||||
scenesConnection(
|
||||
filter: {
|
||||
effectiveDate: {
|
||||
or: [
|
||||
{
|
||||
date: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after
|
||||
}
|
||||
},
|
||||
{
|
||||
date: {
|
||||
isNull: true
|
||||
},
|
||||
createdAt: {
|
||||
lessThan: $beforeTime,
|
||||
greaterThan: $afterTime,
|
||||
}
|
||||
}
|
||||
]
|
||||
and: [
|
||||
{
|
||||
or: $includedEntities
|
||||
|
@ -241,7 +254,6 @@ function initActorActions(store, router) {
|
|||
}
|
||||
${actorStashesFields}
|
||||
}
|
||||
${batchFragment}
|
||||
}
|
||||
`, {
|
||||
actorId,
|
||||
|
@ -249,6 +261,8 @@ function initActorActions(store, router) {
|
|||
offset: Math.max(0, (pageNumber - 1)) * limit,
|
||||
after,
|
||||
before,
|
||||
afterTime: store.getters.after,
|
||||
beforeTime: store.getters.before,
|
||||
selectableTags: config.selectableTags,
|
||||
orderBy,
|
||||
exclude: store.state.ui.tagFilter,
|
||||
|
@ -267,7 +281,7 @@ function initActorActions(store, router) {
|
|||
|
||||
return {
|
||||
actor: curateActor(actor, null, curateRelease),
|
||||
releases: actor.scenesConnection.releases.map((release) => curateRelease(release, 'scene', { lastBatch: lastBatch.id })),
|
||||
releases: actor.scenesConnection.releases.map((release) => curateRelease(release)),
|
||||
totalCount: actor.scenesConnection.totalCount,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,11 +7,6 @@ export default {
|
|||
mediaPath: '/media',
|
||||
s3Path: 'https://s3.wasabisys.com',
|
||||
},
|
||||
campaigns: {
|
||||
home: true,
|
||||
entity: true,
|
||||
tiles: 0,
|
||||
},
|
||||
showDisclaimer: false,
|
||||
disclaimer: 'This site is in early development, and content may occasionally disappear. Please stay tuned, you will be able to use traxxx to its full potential in the near future!',
|
||||
selectableTags: [
|
||||
|
|
|
@ -65,22 +65,20 @@ function curateActor(actor, release) {
|
|||
return curatedActor;
|
||||
}
|
||||
|
||||
function curateRelease(release, type = 'scene', context = {}) {
|
||||
function curateRelease(release, type = 'scene') {
|
||||
const curatedRelease = {
|
||||
...release,
|
||||
type: release.type || type,
|
||||
actors: [],
|
||||
poster: release.poster && release.poster.media,
|
||||
tags: release.tags ? release.tags.map((tag) => tag.tag || tag) : [],
|
||||
isNew: release.createdBatchId === context.lastBatch,
|
||||
};
|
||||
|
||||
curatedRelease.scenes = release.scenes?.filter(Boolean).map(({ scene }) => curateRelease(scene, 'scene', context)) || [];
|
||||
curatedRelease.movies = release.movies?.filter(Boolean).map(({ movie }) => curateRelease(movie, 'movie', context)) || [];
|
||||
curatedRelease.series = release.series?.filter(Boolean).map(({ serie }) => curateRelease(serie, 'serie', context)) || [];
|
||||
curatedRelease.chapters = release.chapters?.filter(Boolean).map((chapter) => curateRelease(chapter, 'chapter', context)) || [];
|
||||
curatedRelease.scenes = release.scenes?.filter(Boolean).map(({ scene }) => curateRelease(scene, 'scene')) || [];
|
||||
curatedRelease.movies = release.movies?.filter(Boolean).map(({ movie }) => curateRelease(movie, 'movie')) || [];
|
||||
curatedRelease.series = release.series?.filter(Boolean).map(({ serie }) => curateRelease(serie, 'serie')) || [];
|
||||
curatedRelease.chapters = release.chapters?.filter(Boolean).map((chapter) => curateRelease(chapter)) || [];
|
||||
curatedRelease.photos = release.photos?.filter(Boolean).map((photo) => photo.media || photo) || [];
|
||||
curatedRelease.caps = release.caps?.filter(Boolean).map((cap) => cap.media || cap) || [];
|
||||
curatedRelease.scenesPhotos = release.scenesPhotos?.filter(Boolean).map((photo) => photo.media || photo) || [];
|
||||
curatedRelease.covers = release.covers?.filter(Boolean).map(({ media }) => media) || [];
|
||||
|
||||
|
@ -104,7 +102,7 @@ function curateRelease(release, type = 'scene', context = {}) {
|
|||
return curatedRelease;
|
||||
}
|
||||
|
||||
function curateEntity(entity, parent, releases, context) {
|
||||
function curateEntity(entity, parent, releases) {
|
||||
const curatedEntity = {
|
||||
...entity,
|
||||
children: [],
|
||||
|
@ -122,19 +120,19 @@ function curateEntity(entity, parent, releases, context) {
|
|||
}
|
||||
|
||||
if (entity.parent || parent) curatedEntity.parent = curateEntity(entity.parent || parent);
|
||||
if (releases) curatedEntity.releases = releases.map((release) => curateRelease(release, 'scene', context));
|
||||
if (releases) curatedEntity.releases = releases.map((release) => curateRelease(release));
|
||||
|
||||
curatedEntity.sceneTotal = entity.sceneTotal;
|
||||
|
||||
return curatedEntity;
|
||||
}
|
||||
|
||||
function curateTag(tag, context) {
|
||||
function curateTag(tag) {
|
||||
const curatedTag = {
|
||||
...tag,
|
||||
};
|
||||
|
||||
if (tag.releases) curatedTag.releases = tag.releases.map(({ release }) => curateRelease(release, 'scene', context));
|
||||
if (tag.releases) curatedTag.releases = tag.releases.map(({ release }) => curateRelease(release));
|
||||
if (tag.banners) curatedTag.banners = tag.banners.map(({ banner }) => banner);
|
||||
if (tag.photos) curatedTag.photos = tag.photos.map(({ media }) => media);
|
||||
if (tag.poster) curatedTag.poster = tag.poster.media;
|
||||
|
@ -142,14 +140,14 @@ function curateTag(tag, context) {
|
|||
return curatedTag;
|
||||
}
|
||||
|
||||
function curateStash(stash, context) {
|
||||
function curateStash(stash) {
|
||||
const curatedStash = stash;
|
||||
|
||||
if (stash.scenes || stash.scenesConnection?.scenes) {
|
||||
curatedStash.sceneTotal = stash.scenesConnection?.totalCount || null;
|
||||
curatedStash.scenes = (stash.scenesConnection?.scenes || stash.scenes).map((item) => ({
|
||||
...item,
|
||||
scene: curateRelease(item.scene, 'scene', context),
|
||||
scene: curateRelease(item.scene),
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -165,7 +163,7 @@ function curateStash(stash, context) {
|
|||
curatedStash.movieTotal = stash.moviesConnection?.totalCount || null;
|
||||
curatedStash.movies = (stash.moviesConnection?.movies || stash.movies).map((item) => ({
|
||||
...item,
|
||||
movie: curateRelease(item.movie, 'movie', context),
|
||||
movie: curateRelease(item.movie),
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -191,10 +189,6 @@ function curateAlert(alert) {
|
|||
curatedAlert.entity = curateEntity(alert.entity.entity || alert.entity);
|
||||
}
|
||||
|
||||
if (alert.entities) {
|
||||
curatedAlert.entities = alert.entities.map((entity) => curateEntity(entity.entity || entity));
|
||||
}
|
||||
|
||||
if (alert.stashes) {
|
||||
curatedAlert.stashes = alert.stashes.map((stash) => curateStash(stash.stash || stash));
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { graphql } from '../api';
|
||||
// import { sitesFragment, releaseFields } from '../fragments';
|
||||
import { releaseFields, batchFragment, campaignsFragment } from '../fragments';
|
||||
import { releaseFields, campaignsFragment } from '../fragments';
|
||||
import { curateEntity } from '../curate';
|
||||
import getDateRange from '../get-date-range';
|
||||
|
||||
|
@ -14,7 +14,7 @@ function initEntitiesActions(store, router) {
|
|||
}) {
|
||||
const { before, after, orderBy } = getDateRange(range);
|
||||
|
||||
const { entity, connection, batches: [lastBatch] } = await graphql(`
|
||||
const { entity } = await graphql(`
|
||||
query Entity(
|
||||
$entitySlug: String!
|
||||
$entityType: String! = "channel"
|
||||
|
@ -22,7 +22,7 @@ function initEntitiesActions(store, router) {
|
|||
$offset: Int = 0,
|
||||
$after: Datetime = "1900-01-01",
|
||||
$before: Datetime = "2100-01-01",
|
||||
$orderBy: [ReleasesSummariesOrderBy!]
|
||||
$orderBy: [ReleasesOrderBy!]
|
||||
$exclude: [String!]
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
|
@ -67,6 +67,7 @@ function initEntitiesActions(store, router) {
|
|||
independent
|
||||
hasLogo
|
||||
${campaignsFragment}
|
||||
sceneTotal
|
||||
children: childEntitiesConnection {
|
||||
totalCount
|
||||
}
|
||||
|
@ -83,52 +84,32 @@ function initEntitiesActions(store, router) {
|
|||
hasLogo
|
||||
${campaignsFragment}
|
||||
}
|
||||
}
|
||||
connection: releasesSummariesConnection(
|
||||
connection: scenesConnection(
|
||||
first: $limit
|
||||
offset: $offset
|
||||
orderBy: $orderBy
|
||||
filter: {
|
||||
effectiveDate: { lessThan: $before, greaterThan: $after }
|
||||
showcased: { equalTo: true }
|
||||
and: [
|
||||
{
|
||||
or: [
|
||||
{
|
||||
not: { tags: { overlaps: $exclude } }
|
||||
effectiveDate: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after
|
||||
}
|
||||
{
|
||||
tags: { isNull: true }
|
||||
releasesTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
slug: {
|
||||
in: $exclude
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
or: [
|
||||
{
|
||||
channelSlug: { equalTo: $entitySlug }
|
||||
channelType: { equalTo: $entityType }
|
||||
}
|
||||
{
|
||||
networkSlug: { equalTo: $entitySlug }
|
||||
networkType: { equalTo: $entityType }
|
||||
}
|
||||
{
|
||||
parentNetworkSlug: { equalTo: $entitySlug }
|
||||
parentNetworkType: { equalTo: $entityType }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
) {
|
||||
releases: nodes {
|
||||
release {
|
||||
${releaseFields}
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
${batchFragment}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
entitySlug,
|
||||
|
@ -149,8 +130,8 @@ function initEntitiesActions(store, router) {
|
|||
}
|
||||
|
||||
return {
|
||||
entity: curateEntity(entity, null, connection.releases.map(({ release }) => release), { lastBatch: lastBatch?.id }),
|
||||
totalCount: connection.totalCount,
|
||||
entity: curateEntity(entity, null, entity.connection.releases),
|
||||
totalCount: entity.connection.totalCount,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ const actorFields = `
|
|||
ageFromBirth
|
||||
dateOfBirth
|
||||
gender
|
||||
orientation
|
||||
avatar: avatarMedia {
|
||||
id
|
||||
path
|
||||
|
@ -97,13 +96,6 @@ const actorFields = `
|
|||
${actorStashesFields}
|
||||
`;
|
||||
|
||||
const basicActorFields = `
|
||||
id
|
||||
name
|
||||
slug
|
||||
gender
|
||||
`;
|
||||
|
||||
const movieFields = `
|
||||
id
|
||||
title
|
||||
|
@ -173,7 +165,27 @@ const movieFields = `
|
|||
}
|
||||
`;
|
||||
|
||||
const campaignFields = `
|
||||
const campaignsFragment = `
|
||||
campaigns(filter: {
|
||||
or: [
|
||||
{
|
||||
banner: {
|
||||
bannersTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
slug: {
|
||||
in: $exclude
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
bannerExists: false
|
||||
}
|
||||
]
|
||||
}) {
|
||||
id
|
||||
url
|
||||
affiliate {
|
||||
|
@ -212,30 +224,6 @@ const campaignFields = `
|
|||
slug
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const campaignsFragment = `
|
||||
campaigns(filter: {
|
||||
or: [
|
||||
{
|
||||
banner: {
|
||||
bannersTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
slug: {
|
||||
in: $exclude
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
bannerExists: false
|
||||
}
|
||||
]
|
||||
}) {
|
||||
${campaignFields}
|
||||
}
|
||||
`;
|
||||
|
||||
|
@ -247,14 +235,6 @@ const releaseActorsFragment = `
|
|||
}
|
||||
`;
|
||||
|
||||
const releaseBasicActorsFragment = `
|
||||
actors: releasesActors(orderBy: ACTOR_BY_ACTOR_ID__GENDER_ASC) {
|
||||
actor {
|
||||
${basicActorFields}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const releaseDirectorFragment = `
|
||||
directors: releasesDirectors(orderBy: ACTOR_BY_DIRECTOR_ID__NAME_ASC) {
|
||||
director {
|
||||
|
@ -354,31 +334,6 @@ const releasePhotosFragment = `
|
|||
}
|
||||
`;
|
||||
|
||||
const releaseCapsFragment = `
|
||||
caps: releasesCaps(orderBy: MEDIA_BY_MEDIA_ID__INDEX_ASC) {
|
||||
media {
|
||||
id
|
||||
index
|
||||
path
|
||||
thumbnail
|
||||
width
|
||||
height
|
||||
thumbnailWidth
|
||||
thumbnailHeight
|
||||
lazy
|
||||
isS3
|
||||
comment
|
||||
sfw: sfwMedia {
|
||||
id
|
||||
thumbnail
|
||||
lazy
|
||||
path
|
||||
comment
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const releaseTrailerFragment = `
|
||||
trailer: releasesTrailer {
|
||||
media {
|
||||
|
@ -419,11 +374,11 @@ const releaseFields = `
|
|||
createdAt
|
||||
url
|
||||
createdBatchId
|
||||
${releaseBasicActorsFragment}
|
||||
${releaseActorsFragment}
|
||||
${releaseTagsFragment}
|
||||
${releasePosterFragment}
|
||||
${releaseCoversFragment}
|
||||
${releasePhotosFragment}
|
||||
${releaseCapsFragment}
|
||||
${siteFragment}
|
||||
studio {
|
||||
id
|
||||
|
@ -438,6 +393,7 @@ const releaseFields = `
|
|||
slug
|
||||
}
|
||||
}
|
||||
isNew
|
||||
isFavorited
|
||||
isStashed(includeFavorites: false)
|
||||
stashes: stashesScenesBySceneId(
|
||||
|
@ -457,23 +413,22 @@ const releaseFields = `
|
|||
}
|
||||
}
|
||||
`;
|
||||
// isNew too performance-intensive
|
||||
|
||||
/*
|
||||
const releasesFragment = `
|
||||
connection: releasesConnection(
|
||||
filter: {
|
||||
releasesNotShowcasedsConnectionExist: false
|
||||
effectiveDate: {
|
||||
date: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after
|
||||
}
|
||||
releasesTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
slug: {
|
||||
in: $exclude
|
||||
}
|
||||
or: [
|
||||
{ slug: { in: $exclude } }
|
||||
{ name: { in: $exclude } }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -488,35 +443,6 @@ const releasesFragment = `
|
|||
totalCount
|
||||
}
|
||||
`;
|
||||
*/
|
||||
|
||||
const releasesFragment = `
|
||||
connection: releasesSummariesConnection(
|
||||
first: $limit
|
||||
offset: $offset
|
||||
orderBy: $orderBy
|
||||
filter: {
|
||||
or: [
|
||||
{
|
||||
not: { tags: { overlaps: $exclude } }
|
||||
}
|
||||
{
|
||||
tags: { isNull: true }
|
||||
}
|
||||
]
|
||||
effectiveDate: { lessThan: $before, greaterThan: $after }
|
||||
showcased: { equalTo: true }
|
||||
batchShowcased: { in: $batchShowcased }
|
||||
}
|
||||
) {
|
||||
releases: nodes {
|
||||
release {
|
||||
${releaseFields}
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
`;
|
||||
|
||||
const mediaFields = `
|
||||
id
|
||||
|
@ -545,7 +471,6 @@ const releaseFragment = `
|
|||
release(id: $releaseId) {
|
||||
id
|
||||
title
|
||||
altTitles
|
||||
description
|
||||
date
|
||||
datePrecision
|
||||
|
@ -553,7 +478,6 @@ const releaseFragment = `
|
|||
createdAt
|
||||
shootId
|
||||
qualities
|
||||
photoCount
|
||||
productionDate
|
||||
createdBatchId
|
||||
productionLocation
|
||||
|
@ -571,7 +495,6 @@ const releaseFragment = `
|
|||
${releaseTagsFragment}
|
||||
${releasePosterFragment}
|
||||
${releasePhotosFragment}
|
||||
${releaseCapsFragment}
|
||||
${releaseCoversFragment}
|
||||
${releaseTrailerFragment}
|
||||
${releaseTeaserFragment}
|
||||
|
@ -613,7 +536,6 @@ const releaseFragment = `
|
|||
name
|
||||
slug
|
||||
url
|
||||
showcased
|
||||
}
|
||||
movies: moviesScenesBySceneId {
|
||||
movie {
|
||||
|
@ -674,16 +596,6 @@ const releaseFragment = `
|
|||
}
|
||||
`;
|
||||
|
||||
const batchFragment = `
|
||||
batches(
|
||||
first: 1,
|
||||
orderBy: CREATED_AT_DESC,
|
||||
filter: { showcased: { equalTo: true } }
|
||||
) {
|
||||
id
|
||||
}
|
||||
`;
|
||||
|
||||
function getIncludedEntities(router) {
|
||||
const includedChannels = router.currentRoute.value.query.channels ? router.currentRoute.value.query.channels.split(',') : [];
|
||||
const includedNetworks = router.currentRoute.value.query.networks ? router.currentRoute.value.query.networks.split(',') : [];
|
||||
|
@ -750,8 +662,6 @@ function getIncludedActors(router) {
|
|||
export {
|
||||
actorFields,
|
||||
actorStashesFields,
|
||||
batchFragment,
|
||||
campaignFields,
|
||||
campaignsFragment,
|
||||
mediaFields,
|
||||
mediaFragment,
|
||||
|
|
|
@ -12,7 +12,7 @@ const dateRanges = {
|
|||
upcoming: () => ({
|
||||
after: dayjs.utc().toDate(),
|
||||
before: '2100-01-01',
|
||||
orderBy: ['EFFECTIVE_DATE_ASC'],
|
||||
orderBy: ['EFFECTIVE_DATE_DESC'],
|
||||
}),
|
||||
new: () => ({
|
||||
after: '1900-01-01 00:00:00',
|
||||
|
|
|
@ -8,7 +8,6 @@ import router from './router';
|
|||
import initStore from './store';
|
||||
import initUiObservers from './ui/observers';
|
||||
import initAuthObservers from './auth/observers';
|
||||
import setPageTitle from './set-page-title';
|
||||
|
||||
import { formatDate, formatDuration } from './format';
|
||||
|
||||
|
@ -102,7 +101,12 @@ async function init() {
|
|||
},
|
||||
watch: {
|
||||
pageTitle(title) {
|
||||
setPageTitle(title); // for Options API components
|
||||
if (title) {
|
||||
document.title = `traxxx - ${title}`;
|
||||
return;
|
||||
}
|
||||
|
||||
document.title = 'traxxx';
|
||||
},
|
||||
},
|
||||
beforeCreate() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { graphql } from '../api';
|
||||
// import { sitesFragment, releaseFields } from '../fragments';
|
||||
import { releaseFields } from '../fragments';
|
||||
import { curateEntity } from '../curate';
|
||||
import { curateNetwork } from '../curate';
|
||||
import getDateRange from '../get-date-range';
|
||||
|
||||
function initNetworksActions(store, _router) {
|
||||
|
@ -59,10 +59,23 @@ function initNetworksActions(store, _router) {
|
|||
{ parent: { parent: { slug: { equalTo: $networkSlug } } } }
|
||||
]
|
||||
}
|
||||
effectiveDate: {
|
||||
or: [
|
||||
{
|
||||
date: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after
|
||||
}
|
||||
},
|
||||
{
|
||||
date: {
|
||||
isNull: true
|
||||
},
|
||||
createdAt: {
|
||||
lessThan: $beforeTime,
|
||||
greaterThan: $afterTime,
|
||||
}
|
||||
}
|
||||
]
|
||||
releasesTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
|
@ -93,7 +106,7 @@ function initNetworksActions(store, _router) {
|
|||
});
|
||||
|
||||
return {
|
||||
network: curateEntity(network, releases),
|
||||
network: curateNetwork(network, releases),
|
||||
totalCount,
|
||||
};
|
||||
}
|
||||
|
@ -118,7 +131,7 @@ function initNetworksActions(store, _router) {
|
|||
}
|
||||
`);
|
||||
|
||||
return networks.map((network) => curateEntity(network));
|
||||
return networks.map(network => curateNetwork(network));
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { graphql } from '../api';
|
||||
import {
|
||||
batchFragment,
|
||||
releasesFragment,
|
||||
releaseFragment,
|
||||
releaseFields,
|
||||
|
@ -15,7 +14,7 @@ function initReleasesActions(store, router) {
|
|||
async function fetchReleases({ _commit }, { limit = 10, pageNumber = 1, range = 'latest' }) {
|
||||
const { before, after, orderBy } = getDateRange(range);
|
||||
|
||||
const { connection: { releases, totalCount }, batches: [lastBatch] } = await graphql(`
|
||||
const { connection: { releases, totalCount } } = await graphql(`
|
||||
query Releases(
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
|
@ -23,12 +22,10 @@ function initReleasesActions(store, router) {
|
|||
$offset:Int = 0,
|
||||
$after:Datetime = "1900-01-01 00:00:00",
|
||||
$before:Datetime = "2100-01-01 00:00:00",
|
||||
$orderBy: [ReleasesSummariesOrderBy!],
|
||||
$exclude: [String!],
|
||||
$batchShowcased: [Boolean!]
|
||||
$orderBy: [ReleasesOrderBy!],
|
||||
$exclude: [String!]
|
||||
) {
|
||||
${releasesFragment}
|
||||
${batchFragment}
|
||||
}
|
||||
`, {
|
||||
hasAuth: !!store.state.auth.user,
|
||||
|
@ -39,11 +36,10 @@ function initReleasesActions(store, router) {
|
|||
before,
|
||||
orderBy,
|
||||
exclude: store.state.ui.tagFilter,
|
||||
batchShowcased: range === 'new' ? true : [true, false],
|
||||
});
|
||||
|
||||
return {
|
||||
releases: releases.map((release) => curateRelease(release.release || release, 'scene', { lastBatch: lastBatch.id })),
|
||||
releases: releases.map((release) => curateRelease(release.release || release)),
|
||||
totalCount,
|
||||
};
|
||||
}
|
||||
|
@ -84,7 +80,12 @@ function initReleasesActions(store, router) {
|
|||
connection: moviesConnection(
|
||||
first: $limit
|
||||
offset: $offset
|
||||
orderBy: EFFECTIVE_DATE_DESC
|
||||
orderBy: DATE_DESC
|
||||
filter: {
|
||||
date: {
|
||||
isNull: false
|
||||
}
|
||||
}
|
||||
) {
|
||||
movies: nodes {
|
||||
${movieFields}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
|
||||
import setPageTitle from './set-page-title';
|
||||
|
||||
import Home from '../components/home/home.vue';
|
||||
import Login from '../components/auth/login.vue';
|
||||
import Signup from '../components/auth/signup.vue';
|
||||
|
@ -235,7 +233,7 @@ const routes = [
|
|||
name: 'notifications',
|
||||
},
|
||||
{
|
||||
path: '/stash/:username/:stashSlug',
|
||||
path: '/stash/:stashId/:stashSlug',
|
||||
redirect: (from) => ({
|
||||
name: 'stash',
|
||||
params: {
|
||||
|
@ -246,7 +244,7 @@ const routes = [
|
|||
}),
|
||||
},
|
||||
{
|
||||
path: '/stash/:username/:stashSlug/:range/:pageNumber',
|
||||
path: '/stash/:stashId/:stashSlug?/:range/:pageNumber',
|
||||
component: Stash,
|
||||
name: 'stash',
|
||||
},
|
||||
|
@ -259,17 +257,11 @@ const routes = [
|
|||
path: '/stats',
|
||||
component: Stats,
|
||||
name: 'stats',
|
||||
meta: {
|
||||
title: 'Stats',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/not-found',
|
||||
name: 'not-found',
|
||||
component: NotFound,
|
||||
meta: {
|
||||
title: 'Not Found',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/:catchAll(.*)',
|
||||
|
@ -284,6 +276,4 @@ const router = createRouter({
|
|||
routes,
|
||||
});
|
||||
|
||||
router.beforeEach((to) => setPageTitle(to.meta.title));
|
||||
|
||||
export default router;
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
function setPageTitle(name) {
|
||||
if (name) {
|
||||
document.title = `traxxx - ${name}`;
|
||||
return;
|
||||
}
|
||||
|
||||
document.title = 'traxxx';
|
||||
}
|
||||
|
||||
export default setPageTitle;
|
|
@ -1,6 +1,6 @@
|
|||
import { graphql } from '../api';
|
||||
import { releaseFields } from '../fragments';
|
||||
import { curateEntity, curateRelease } from '../curate';
|
||||
import { curateSite, curateRelease } from '../curate';
|
||||
import getDateRange from '../get-date-range';
|
||||
|
||||
function initSitesActions(store, _router) {
|
||||
|
@ -41,7 +41,7 @@ function initSitesActions(store, _router) {
|
|||
}
|
||||
releasesConnection(
|
||||
filter: {
|
||||
effectiveDate: {
|
||||
date: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after,
|
||||
},
|
||||
|
@ -75,7 +75,7 @@ function initSitesActions(store, _router) {
|
|||
equalTo: $siteSlug
|
||||
}
|
||||
}
|
||||
effectiveDate: {
|
||||
date: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after
|
||||
}
|
||||
|
@ -103,12 +103,13 @@ function initSitesActions(store, _router) {
|
|||
after,
|
||||
before,
|
||||
orderBy,
|
||||
isNew: store.getters.isNew,
|
||||
exclude: store.state.ui.filter,
|
||||
});
|
||||
|
||||
return {
|
||||
site: curateEntity(site),
|
||||
releases: releases.map((release) => curateRelease(release)),
|
||||
site: curateSite(site),
|
||||
releases: releases.map(release => curateRelease(release)),
|
||||
totalCount,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,16 +10,14 @@ import { curateStash } from '../curate';
|
|||
|
||||
function initStashesActions(store, _router) {
|
||||
async function fetchStash(context, {
|
||||
stashSlug,
|
||||
username,
|
||||
stashId,
|
||||
section = 'scenes',
|
||||
pageNumber = 1,
|
||||
limit = 20,
|
||||
}) {
|
||||
const { stashes: [stash] } = await graphql(`
|
||||
const { stash } = await graphql(`
|
||||
query Stash(
|
||||
$stashSlug: String!
|
||||
$username: String!
|
||||
$stashId: Int!
|
||||
$includeScenes: Boolean!
|
||||
$includeActors: Boolean!
|
||||
$includeMovies: Boolean!
|
||||
|
@ -28,12 +26,7 @@ function initStashesActions(store, _router) {
|
|||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
) {
|
||||
stashes(
|
||||
filter: {
|
||||
user: { username: { equalTo: $username } }
|
||||
slug: { equalTo: $stashSlug }
|
||||
}
|
||||
) {
|
||||
stash(id: $stashId) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
|
@ -108,8 +101,7 @@ function initStashesActions(store, _router) {
|
|||
}
|
||||
}
|
||||
`, {
|
||||
stashSlug,
|
||||
username,
|
||||
stashId: Number(stashId),
|
||||
includeScenes: section === 'scenes',
|
||||
includeActors: section === 'actors',
|
||||
includeMovies: section === 'movies',
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { graphql, get } from '../api';
|
||||
import {
|
||||
releaseFields,
|
||||
batchFragment,
|
||||
} from '../fragments';
|
||||
import { curateTag, curateRelease } from '../curate';
|
||||
import getDateRange from '../get-date-range';
|
||||
|
@ -15,14 +14,14 @@ function initTagsActions(store, _router) {
|
|||
}) {
|
||||
const { before, after, orderBy } = getDateRange(range);
|
||||
|
||||
const { tagBySlug, scenesConnection, batches: [lastBatch] } = await graphql(`
|
||||
const { tagBySlug } = await graphql(`
|
||||
query Tag(
|
||||
$tagSlug:String!
|
||||
$offset: Int = 0,
|
||||
$limit:Int = 1000,
|
||||
$after:Datetime = "1900-01-01",
|
||||
$before:Datetime = "2100-01-01",
|
||||
$orderBy: [ReleasesSummariesOrderBy!],
|
||||
$orderBy: [ReleasesOrderBy!],
|
||||
$exclude: [String!]
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
|
@ -155,33 +154,32 @@ function initTagsActions(store, _router) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
scenesConnection: releasesSummariesConnection(
|
||||
first: $limit
|
||||
offset: $offset
|
||||
orderBy: $orderBy
|
||||
scenesConnection(
|
||||
filter: {
|
||||
or: [
|
||||
{
|
||||
not: { tags: { overlaps: $exclude } }
|
||||
date: {
|
||||
lessThan: $before,
|
||||
greaterThan: $after,
|
||||
},
|
||||
releasesTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
slug: {
|
||||
in: $exclude
|
||||
}
|
||||
{
|
||||
tags: { isNull: true }
|
||||
}
|
||||
]
|
||||
tags: { anyEqualTo: $tagSlug }
|
||||
effectiveDate: { lessThan: $before, greaterThan: $after }
|
||||
showcased: { equalTo: true }
|
||||
}
|
||||
}
|
||||
},
|
||||
first: $limit,
|
||||
orderBy: $orderBy,
|
||||
offset: $offset
|
||||
) {
|
||||
releases: nodes {
|
||||
release {
|
||||
${releaseFields}
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
${batchFragment}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
tagSlug,
|
||||
|
@ -197,8 +195,8 @@ function initTagsActions(store, _router) {
|
|||
|
||||
return {
|
||||
tag: curateTag(tagBySlug, null, curateRelease),
|
||||
releases: scenesConnection.releases.map(({ release }) => curateRelease(release, 'scene', { lastBatch: lastBatch.id })),
|
||||
totalCount: scenesConnection.totalCount,
|
||||
releases: tagBySlug.scenesConnection.releases.map((release) => curateRelease(release)),
|
||||
totalCount: tagBySlug.scenesConnection.totalCount,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,5 @@
|
|||
import { graphql, patch } from '../api';
|
||||
|
||||
import {
|
||||
releaseFields,
|
||||
batchFragment,
|
||||
campaignFields,
|
||||
actorStashesFields,
|
||||
} from '../fragments';
|
||||
|
||||
import { releaseFields, actorStashesFields } from '../fragments';
|
||||
import { curateRelease, curateActor, curateNotification } from '../curate';
|
||||
|
||||
function initUiActions(store, _router) {
|
||||
|
@ -68,7 +61,6 @@ function initUiActions(store, _router) {
|
|||
${releaseFields}
|
||||
}
|
||||
alert {
|
||||
all
|
||||
tags: alertsTags {
|
||||
tag {
|
||||
id
|
||||
|
@ -83,7 +75,7 @@ function initUiActions(store, _router) {
|
|||
slug
|
||||
}
|
||||
}
|
||||
entities: alertsEntities {
|
||||
entity: alertsEntity {
|
||||
entity {
|
||||
id
|
||||
name
|
||||
|
@ -91,10 +83,6 @@ function initUiActions(store, _router) {
|
|||
independent
|
||||
}
|
||||
}
|
||||
matches: alertsMatches {
|
||||
property
|
||||
expression
|
||||
}
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
|
@ -230,7 +218,6 @@ function initUiActions(store, _router) {
|
|||
}
|
||||
${actorStashesFields}
|
||||
}
|
||||
${batchFragment}
|
||||
}
|
||||
`, {
|
||||
query,
|
||||
|
@ -240,7 +227,7 @@ function initUiActions(store, _router) {
|
|||
});
|
||||
|
||||
return {
|
||||
releases: res?.results.map((result) => curateRelease(result.release, 'scene', { lastBatch: res?.batches[0].id })) || [],
|
||||
releases: res?.results.map((result) => curateRelease(result.release)) || [],
|
||||
actors: res?.actors.map((actor) => curateActor(actor)) || [],
|
||||
};
|
||||
}
|
||||
|
@ -252,7 +239,29 @@ function initUiActions(store, _router) {
|
|||
$maxRatio: BigFloat
|
||||
) {
|
||||
randomCampaign: getRandomCampaign(minRatio: $minRatio, maxRatio: $maxRatio) {
|
||||
${campaignFields}
|
||||
url
|
||||
affiliate {
|
||||
url
|
||||
}
|
||||
banner {
|
||||
id
|
||||
type
|
||||
ratio
|
||||
entity {
|
||||
type
|
||||
slug
|
||||
parent {
|
||||
type
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
entity {
|
||||
slug
|
||||
}
|
||||
parent {
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
|
@ -263,22 +272,6 @@ function initUiActions(store, _router) {
|
|||
return randomCampaign;
|
||||
}
|
||||
|
||||
async function fetchCampaign(context, campaignId) {
|
||||
const { campaign } = await graphql(`
|
||||
query Campaign(
|
||||
$campaignId: Int!
|
||||
) {
|
||||
campaign(id: $campaignId) {
|
||||
${campaignFields}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
campaignId: Number(campaignId),
|
||||
});
|
||||
|
||||
return campaign;
|
||||
}
|
||||
|
||||
async function fetchStats() {
|
||||
const {
|
||||
scenes,
|
||||
|
@ -286,15 +279,23 @@ function initUiActions(store, _router) {
|
|||
actors,
|
||||
networks,
|
||||
channels,
|
||||
batches: [batch],
|
||||
} = await graphql(`
|
||||
query Stats {
|
||||
scenes: releasesConnection { totalCount }
|
||||
scenes: releasesConnection(
|
||||
last: 1,
|
||||
orderBy: BATCH_BY_CREATED_BATCH_ID__CREATED_AT_ASC
|
||||
) {
|
||||
totalCount
|
||||
scenes: nodes {
|
||||
batch: createdBatch {
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
}
|
||||
movies: moviesConnection { totalCount }
|
||||
actors: actorsConnection { totalCount }
|
||||
networks: entitiesConnection(filter: { type: { equalTo: "network" } }) { totalCount }
|
||||
channels: entitiesConnection(filter: { type: { equalTo: "channel" } }) { totalCount }
|
||||
batches(orderBy: CREATED_AT_DESC, first: 1) { createdAt }
|
||||
}
|
||||
`);
|
||||
|
||||
|
@ -304,7 +305,7 @@ function initUiActions(store, _router) {
|
|||
totalActors: actors.totalCount,
|
||||
totalNetworks: networks.totalCount,
|
||||
totalChannels: channels.totalCount,
|
||||
lastScrape: new Date(batch.createdAt),
|
||||
lastScrape: new Date(scenes.scenes[0]?.batch.createdAt),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -318,7 +319,6 @@ function initUiActions(store, _router) {
|
|||
setBatch,
|
||||
setSfw,
|
||||
setTheme,
|
||||
fetchCampaign,
|
||||
fetchRandomCampaign,
|
||||
fetchNotifications,
|
||||
fetchStats,
|
||||
|
|
|
@ -71,7 +71,6 @@ function initUsersActions(store, _router) {
|
|||
id
|
||||
notify
|
||||
email
|
||||
all
|
||||
stashes: alertsStashes {
|
||||
stash {
|
||||
id
|
||||
|
@ -86,17 +85,12 @@ function initUsersActions(store, _router) {
|
|||
slug
|
||||
}
|
||||
}
|
||||
matches: alertsMatches {
|
||||
id
|
||||
property
|
||||
expression
|
||||
}
|
||||
actors: alertsActors {
|
||||
actor {
|
||||
${actorFields}
|
||||
}
|
||||
}
|
||||
entities: alertsEntities {
|
||||
entity: alertsEntity {
|
||||
entity {
|
||||
id
|
||||
name
|
||||
|
|
|
@ -12,8 +12,6 @@ module.exports = {
|
|||
password: 'password',
|
||||
database: 'traxxx',
|
||||
},
|
||||
timeout: 5000,
|
||||
graphiql: false,
|
||||
},
|
||||
web: {
|
||||
host: '0.0.0.0',
|
||||
|
@ -30,20 +28,6 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
},
|
||||
redis: {
|
||||
host: 'localhost',
|
||||
port: 6379,
|
||||
username: null,
|
||||
password: null,
|
||||
},
|
||||
location: {
|
||||
userAgent: 'contact via https://traxxx.me/',
|
||||
},
|
||||
analytics: {
|
||||
enabled: false,
|
||||
address: 'http://localhost:3000/script.js',
|
||||
siteId: '1b28ac3b-d229-43bf-aec9-75cf0a72a466',
|
||||
},
|
||||
s3: {
|
||||
enabled: false,
|
||||
bucket: 'traxxx',
|
||||
|
@ -53,8 +37,6 @@ module.exports = {
|
|||
auth: {
|
||||
login: true,
|
||||
signup: true,
|
||||
usernameLength: [2, 24],
|
||||
usernamePattern: /^[a-zA-Z0-9_-]+$/,
|
||||
},
|
||||
exclude: {
|
||||
channels: [
|
||||
|
@ -71,7 +53,6 @@ module.exports = {
|
|||
'amberathome',
|
||||
'marycarey',
|
||||
'racqueldevonshire',
|
||||
'aziani',
|
||||
// blowpass
|
||||
'sunlustxxx',
|
||||
// ddfnetwork
|
||||
|
@ -82,10 +63,6 @@ module.exports = {
|
|||
'lowartfilms',
|
||||
// freeones
|
||||
'freeones',
|
||||
// new sesations
|
||||
'tabutales',
|
||||
'talesfromtheedge',
|
||||
'shanedieselsbangingbabes',
|
||||
// pornpros
|
||||
'milfhumiliation',
|
||||
'humiliated',
|
||||
|
@ -277,21 +254,18 @@ module.exports = {
|
|||
'www.tushyraw.com',
|
||||
'www.deeper.com',
|
||||
'www.slayed.com',
|
||||
'www.milfy.com',
|
||||
'sthw-trailer-vixen.ssl-cdn.com',
|
||||
'sthw-trailer-tushy.ssl-cdn.com',
|
||||
'sthw-trailer-tushyraw.ssl-cdn.com',
|
||||
'sthw-trailer-blacked.ssl-cdn.com',
|
||||
'sthw-trailer-blackedraw.ssl-cdn.com',
|
||||
'sthw-trailer-deeper.ssl-cdn.com',
|
||||
'sthw-trailer-milfy.ssl-cdn.com',
|
||||
'streamhw-trailer-vixen.ssl-cdn.com',
|
||||
'streamhw-trailer-tushy.ssl-cdn.com',
|
||||
'streamhw-trailer-tushyraw.ssl-cdn.com',
|
||||
'streamhw-trailer-blacked.ssl-cdn.com',
|
||||
'streamhw-trailer-blackedraw.ssl-cdn.com',
|
||||
'streamhw-trailer-deeper.ssl-cdn.com',
|
||||
'streamhw-trailer-milfy.ssl-cdn.com',
|
||||
'cdn.vixen.com',
|
||||
'cdn.tushy.com',
|
||||
'cdn.blacked.com',
|
||||
|
@ -299,7 +273,6 @@ module.exports = {
|
|||
'cdn.blackedraw.com',
|
||||
'cdn.tushyraw.com',
|
||||
'cdn.slayed.com',
|
||||
'cdn.milfy.com',
|
||||
'www.vogov.com',
|
||||
'www.vogov.com',
|
||||
'www.nubiles.net',
|
||||
|
@ -324,7 +297,6 @@ module.exports = {
|
|||
enable: false,
|
||||
hostnames: [ // these can run in the same browser session
|
||||
'www.kink.com',
|
||||
'store2.psmcdn.net', // Team Skeet API
|
||||
],
|
||||
},
|
||||
cloudflare: {
|
||||
|
@ -365,20 +337,14 @@ module.exports = {
|
|||
},
|
||||
media: {
|
||||
path: './media',
|
||||
transferSources: {
|
||||
local: 'http://localhost:5000/media',
|
||||
s3: 'https://cdn.traxxx.me',
|
||||
},
|
||||
maxSize: 1000,
|
||||
quality: 80,
|
||||
thumbnailSize: 320, // width for 16:9 will be exactly 576px
|
||||
thumbnailQuality: 100,
|
||||
lazySize: 90,
|
||||
lazyQuality: 90,
|
||||
trailerQuality: [540, 720, 480, 360, 960, 1080, 320, 1440, 1600, 1920, 2160, 270, 240, 180],
|
||||
trailerQuality: [480, 540, 360, 720, 960, 1080, 320, 1440, 1600, 1920, 2160, 270, 240, 180],
|
||||
limit: 25, // max number of photos per release
|
||||
attempts: 2,
|
||||
fetchStreams: true,
|
||||
streamConcurrency: 2, // max number of video streams (m3u8 etc.) to fetch and process at once
|
||||
},
|
||||
titleSlugLength: 50,
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
const config = require('config');
|
||||
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'traxxx',
|
||||
script: 'src/init.js',
|
||||
exec_mode: 'cluster',
|
||||
instances: 2,
|
||||
restart_delay: 3000,
|
||||
args: '--server',
|
||||
merge_logs: true,
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
},
|
||||
},
|
||||
...(config.analytics.enabled ? [{
|
||||
name: 'umami',
|
||||
script: 'npm start',
|
||||
cwd: process.env.UMAMI_DIR || '../umami',
|
||||
restart_delay: 3000,
|
||||
merge_logs: true,
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
},
|
||||
}] : []),
|
||||
],
|
||||
};
|
|
@ -64,7 +64,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
table.boolean('independent')
|
||||
.defaultTo(false);
|
||||
|
||||
table.boolean('showcased');
|
||||
table.boolean('visible')
|
||||
.defaultTo(true);
|
||||
|
||||
|
@ -273,7 +272,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
table.integer('age', 3);
|
||||
|
||||
table.text('gender', 18);
|
||||
table.text('orientation');
|
||||
table.text('description');
|
||||
|
||||
table.text('birth_city');
|
||||
|
@ -347,7 +345,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
|
||||
table.text('real_name');
|
||||
table.text('gender', 18);
|
||||
table.text('orientation');
|
||||
|
||||
table.date('date_of_birth');
|
||||
table.date('date_of_death');
|
||||
|
@ -654,8 +651,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
table.integer('duration')
|
||||
.unsigned();
|
||||
|
||||
table.specificType('qualities', 'text[]');
|
||||
|
||||
table.boolean('deep');
|
||||
table.text('deep_url', 1000);
|
||||
|
||||
|
@ -809,8 +804,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
table.text('original_tag');
|
||||
|
||||
table.unique(['tag_id', 'release_id']);
|
||||
table.index('tag_id');
|
||||
table.index('release_id');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('releases_search', (table) => {
|
||||
table.integer('release_id', 16)
|
||||
|
@ -880,8 +873,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
|
||||
table.index('scene_id');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('movies_covers', (table) => {
|
||||
table.integer('movie_id', 16)
|
||||
|
@ -925,151 +916,12 @@ exports.up = (knex) => Promise.resolve()
|
|||
|
||||
table.unique('movie_id');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('movies_photos', (table) => {
|
||||
table.integer('movie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('movies')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['movie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('movies_search', (table) => {
|
||||
table.integer('movie_id', 16)
|
||||
.references('id')
|
||||
.inTable('movies')
|
||||
.onDelete('cascade');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series', (table) => {
|
||||
table.increments('id', 16);
|
||||
|
||||
table.integer('entity_id', 12)
|
||||
.references('id')
|
||||
.inTable('entities')
|
||||
.notNullable();
|
||||
|
||||
table.integer('studio_id', 12)
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
|
||||
table.text('entry_id');
|
||||
table.unique(['entity_id', 'entry_id']);
|
||||
|
||||
table.text('url', 1000);
|
||||
table.text('title');
|
||||
table.text('slug');
|
||||
|
||||
table.timestamp('date');
|
||||
table.index('date');
|
||||
|
||||
table.enum('date_precision', ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'])
|
||||
.defaultTo('day');
|
||||
|
||||
table.text('description');
|
||||
|
||||
table.boolean('deep');
|
||||
table.text('deep_url', 1000);
|
||||
|
||||
table.text('comment');
|
||||
|
||||
table.integer('created_batch_id', 12)
|
||||
.references('id')
|
||||
.inTable('batches')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('updated_batch_id', 12)
|
||||
.references('id')
|
||||
.inTable('batches')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_scenes', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('scene_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('releases')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.unique(['serie_id', 'scene_id']);
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_trailers', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.unique()
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_posters', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.unique('serie_id');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_covers', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['serie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_photos', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['serie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_search', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('chapters', (table) => {
|
||||
table.increments('id', 16);
|
||||
|
||||
|
@ -1210,8 +1062,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
table.datetime('created_at')
|
||||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
|
||||
table.datetime('last_login');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('stashes', (table) => {
|
||||
table.increments('id');
|
||||
|
@ -1238,12 +1088,7 @@ exports.up = (knex) => Promise.resolve()
|
|||
table.datetime('created_at')
|
||||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
|
||||
table.unique(['user_id', 'slug']);
|
||||
}))
|
||||
.then(() => knex.raw(`
|
||||
CREATE UNIQUE INDEX unique_primary ON stashes (user_id, "primary") WHERE ("primary" = TRUE);
|
||||
`))
|
||||
.then(() => knex.schema.createTable('stashes_scenes', (table) => {
|
||||
table.integer('stash_id')
|
||||
.notNullable()
|
||||
|
@ -1307,27 +1152,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('stashes_series', (table) => {
|
||||
table.integer('stash_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('stashes')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('serie_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.unique(['stash_id', 'serie_id']);
|
||||
|
||||
table.string('comment');
|
||||
|
||||
table.datetime('created_at')
|
||||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('alerts', (table) => {
|
||||
table.increments('id');
|
||||
|
||||
|
@ -1505,9 +1329,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.raw(`
|
||||
ALTER TABLE banners ADD COLUMN ratio numeric GENERATED ALWAYS AS (ROUND(width::decimal/ height::decimal, 2)) STORED;
|
||||
`))
|
||||
.then(() => knex.schema.createTable('banners_tags', (table) => {
|
||||
table.increments('id');
|
||||
|
||||
|
@ -1551,46 +1372,17 @@ exports.up = (knex) => Promise.resolve()
|
|||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('random_campaign', (table) => {
|
||||
table.integer('id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('campaigns');
|
||||
|
||||
table.text('banner_id')
|
||||
.references('id')
|
||||
.inTable('banners');
|
||||
|
||||
table.text('url');
|
||||
|
||||
table.integer('entity_id')
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
|
||||
table.string('affiliate_id')
|
||||
.references('id')
|
||||
.inTable('affiliates');
|
||||
|
||||
table.integer('parent_id')
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
}))
|
||||
// SEARCH AND SORT
|
||||
.then(() => { // eslint-disable-line arrow-body-style
|
||||
// allow vim fold
|
||||
return knex.raw(`
|
||||
ALTER TABLE releases_search ADD COLUMN document tsvector;
|
||||
ALTER TABLE movies_search ADD COLUMN document tsvector;
|
||||
ALTER TABLE series_search ADD COLUMN document tsvector;
|
||||
|
||||
/* allow scenes without dates to be mixed inbetween scenes with dates */
|
||||
ALTER TABLE releases
|
||||
ADD COLUMN effective_date timestamptz
|
||||
GENERATED ALWAYS AS (COALESCE(date, created_at)) STORED;
|
||||
|
||||
ALTER TABLE movies
|
||||
ADD COLUMN effective_date timestamptz
|
||||
GENERATED ALWAYS AS (COALESCE(date, created_at)) STORED;
|
||||
`);
|
||||
})
|
||||
// INDEXES
|
||||
|
@ -1609,8 +1401,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
CREATE UNIQUE INDEX movies_search_unique ON movies_search (movie_id);
|
||||
CREATE INDEX releases_search_index ON releases_search USING GIN (document);
|
||||
CREATE INDEX movies_search_index ON movies_search USING GIN (document);
|
||||
CREATE UNIQUE INDEX series_search_unique ON series_search (serie_id);
|
||||
CREATE INDEX series_search_index ON series_search USING GIN (document);
|
||||
`);
|
||||
})
|
||||
// FUNCTIONS
|
||||
|
@ -1631,13 +1421,15 @@ exports.up = (knex) => Promise.resolve()
|
|||
CREATE TABLE movies_search_results (movie_id integer, rank real, FOREIGN KEY (movie_id) REFERENCES movies (id));
|
||||
|
||||
CREATE FUNCTION search_releases(query text) RETURNS SETOF releases_search_results AS $$
|
||||
SELECT results.release_id, ts_rank(results.document::tsvector, curate_search_query(query)) as rank
|
||||
FROM (
|
||||
SELECT releases_search.release_id, document
|
||||
SELECT releases.id, ranks.rank FROM (
|
||||
SELECT
|
||||
releases_search.release_id,
|
||||
ts_rank(releases_search.document, to_tsquery('english', array_to_string(array(SELECT * FROM regexp_matches(query, '[A-Za-zÀ-ÖØ-öø-ÿ0-9]+', 'g')), '|'))) AS rank
|
||||
FROM releases_search
|
||||
WHERE document::tsvector @@ curate_search_query(query)
|
||||
) AS results
|
||||
ORDER BY rank DESC;
|
||||
) ranks
|
||||
LEFT JOIN releases ON releases.id = ranks.release_id
|
||||
WHERE ranks.rank > 0
|
||||
ORDER BY ranks.rank DESC;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION search_movies(query text) RETURNS SETOF movies_search_results AS $$
|
||||
|
@ -1721,52 +1513,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
ORDER BY actors.name;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION entities_scenes(entity entities) RETURNS SETOF releases AS $$
|
||||
WITH RECURSIVE children AS (
|
||||
SELECT entities.id
|
||||
FROM entities
|
||||
WHERE entities.id = entity.id
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT entities.id
|
||||
FROM entities
|
||||
INNER JOIN children ON children.id = entities.parent_id
|
||||
)
|
||||
|
||||
SELECT releases FROM releases
|
||||
INNER JOIN children ON children.id = releases.entity_id
|
||||
|
||||
UNION
|
||||
|
||||
SELECT releases FROM releases
|
||||
INNER JOIN children ON children.id = releases.studio_id;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION entities_scene_total(entity entities) RETURNS bigint AS $$
|
||||
SELECT COUNT(id)
|
||||
FROM releases
|
||||
WHERE releases.entity_id = entity.id;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION entities_scene_tags(entity entities, selectable_tags text[]) RETURNS SETOF tags AS $$
|
||||
SELECT tags.*
|
||||
FROM releases
|
||||
LEFT JOIN
|
||||
releases_tags ON releases_tags.release_id = releases.id
|
||||
LEFT JOIN
|
||||
tags ON tags.id = releases_tags.tag_id
|
||||
WHERE
|
||||
releases.entity_id = entity.id
|
||||
AND
|
||||
CASE WHEN array_length(selectable_tags, 1) IS NOT NULL
|
||||
THEN tags.slug = ANY(selectable_tags)
|
||||
ELSE true
|
||||
END
|
||||
GROUP BY tags.id
|
||||
ORDER BY tags.name;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
/* GraphQL/Postgraphile 'every' applies to the data, will only include scenes for which every assigned tag is selected,
|
||||
instead of what we want; scenes with every selected tag, but possibly also some others */
|
||||
CREATE FUNCTION actors_scenes(actor actors, selected_tags text[], mode text DEFAULT 'all') RETURNS SETOF releases AS $$
|
||||
|
@ -1843,7 +1589,7 @@ exports.up = (knex) => Promise.resolve()
|
|||
ORDER BY tags.priority DESC
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION movies_scenes_photos(movie movies) RETURNS SETOF media AS $$
|
||||
CREATE FUNCTION movies_photos(movie movies) RETURNS SETOF media AS $$
|
||||
SELECT media.*
|
||||
FROM movies_scenes
|
||||
LEFT JOIN
|
||||
|
@ -1861,111 +1607,15 @@ exports.up = (knex) => Promise.resolve()
|
|||
SELECT EXISTS(SELECT true WHERE (SELECT id FROM batches ORDER BY created_at DESC LIMIT 1) = release.created_batch_id);
|
||||
$$ LANGUAGE sql STABLE;
|
||||
|
||||
CREATE FUNCTION series_actors(serie series) RETURNS SETOF actors AS $$
|
||||
SELECT actors.*
|
||||
FROM series_scenes
|
||||
LEFT JOIN
|
||||
releases ON releases.id = series_scenes.scene_id
|
||||
LEFT JOIN
|
||||
releases_actors ON releases_actors.release_id = releases.id
|
||||
LEFT JOIN
|
||||
actors ON actors.id = releases_actors.actor_id
|
||||
WHERE series_scenes.serie_id = serie.id
|
||||
AND actors.id IS NOT NULL
|
||||
GROUP BY actors.id
|
||||
ORDER BY actors.name, actors.gender
|
||||
CREATE FUNCTION banners_ratio(banner banners) RETURNS numeric AS $$
|
||||
SELECT ROUND(banner.width::decimal / banner.height::decimal, 2);
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION series_tags(serie series) RETURNS SETOF tags AS $$
|
||||
SELECT tags.*
|
||||
FROM series_scenes
|
||||
LEFT JOIN
|
||||
releases ON releases.id = series_scenes.scene_id
|
||||
LEFT JOIN
|
||||
releases_tags ON releases_tags.release_id = releases.id
|
||||
LEFT JOIN
|
||||
tags ON tags.id = releases_tags.tag_id
|
||||
WHERE series_scenes.serie_id = serie.id
|
||||
AND tags.id IS NOT NULL
|
||||
GROUP BY tags.id
|
||||
ORDER BY tags.priority DESC
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION series_scenes_photos(serie series) RETURNS SETOF media AS $$
|
||||
SELECT media.*
|
||||
FROM series_scenes
|
||||
LEFT JOIN
|
||||
releases ON releases.id = series_scenes.scene_id
|
||||
INNER JOIN
|
||||
releases_photos ON releases_photos.release_id = releases.id
|
||||
LEFT JOIN
|
||||
media ON media.id = releases_photos.media_id
|
||||
WHERE series_scenes.serie_id = serie.id
|
||||
GROUP BY media.id
|
||||
ORDER BY media.index ASC
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION get_random_campaign(min_ratio decimal default 0, max_ratio decimal default 1000.0) RETURNS random_campaign AS $$
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT ON (CASE WHEN parent_id IS NOT NULL THEN parent_id ELSE entity_id END)
|
||||
id, banner_id, url, entity_id, affiliate_id, parent_id
|
||||
FROM (
|
||||
SELECT
|
||||
campaigns.*, entities.parent_id as parent_id
|
||||
FROM campaigns
|
||||
LEFT JOIN entities ON entities.id = campaigns.entity_id
|
||||
LEFT JOIN banners ON banners.id = campaigns.banner_id
|
||||
WHERE banner_id IS NOT NULL
|
||||
AND ratio >= min_ratio
|
||||
AND ratio <= max_ratio
|
||||
ORDER BY RANDOM()
|
||||
) random_campaigns
|
||||
) random_banners
|
||||
ORDER BY RANDOM()
|
||||
CREATE FUNCTION get_random_campaign() RETURNS SETOF campaigns AS $$
|
||||
SELECT * FROM campaigns
|
||||
ORDER BY random()
|
||||
LIMIT 1;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`);
|
||||
})
|
||||
// VIEWS AND COMMENTS
|
||||
.then(() => { // eslint-disable-line arrow-body-style
|
||||
// allow vim fold
|
||||
return knex.raw(`
|
||||
CREATE MATERIALIZED VIEW releases_not_showcased AS (
|
||||
SELECT releases.id AS release_id FROM releases
|
||||
LEFT JOIN entities AS channels ON channels.id = releases.entity_id
|
||||
LEFT JOIN entities AS studios ON studios.id = releases.studio_id
|
||||
LEFT JOIN entities AS networks ON networks.id = channels.parent_id
|
||||
WHERE (studios.showcased = false)
|
||||
OR (channels.showcased = false AND studios.showcased IS NOT true)
|
||||
OR (networks.showcased = false AND channels.showcased IS NOT true AND studios.showcased IS NOT true)
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX ON releases_not_showcased (release_id);
|
||||
COMMENT ON MATERIALIZED VIEW releases_not_showcased IS E'@foreignKey (release_id) references releases (id)';
|
||||
|
||||
COMMENT ON COLUMN users.password IS E'@omit';
|
||||
COMMENT ON COLUMN users.email IS E'@omit';
|
||||
COMMENT ON COLUMN users.email_verified IS E'@omit';
|
||||
COMMENT ON COLUMN users.abilities IS E'@omit';
|
||||
|
||||
COMMENT ON COLUMN actors.height IS E'@omit read,update,create,delete,all,many';
|
||||
COMMENT ON COLUMN actors.weight IS E'@omit read,update,create,delete,all,many';
|
||||
COMMENT ON COLUMN actors.penis_length IS E'@omit read,update,create,delete,all,many';
|
||||
COMMENT ON COLUMN actors.penis_girth IS E'@omit read,update,create,delete,all,many';
|
||||
|
||||
COMMENT ON FUNCTION entities_scenes IS E'@sortable';
|
||||
|
||||
COMMENT ON FUNCTION actors_tags IS E'@sortable';
|
||||
COMMENT ON FUNCTION actors_channels IS E'@sortable';
|
||||
COMMENT ON FUNCTION actors_actors IS E'@sortable';
|
||||
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
|
||||
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
|
||||
|
||||
COMMENT ON FUNCTION search_releases IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_entities IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_actors IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_movies IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_tags IS E'@sortable';
|
||||
$$ LANGUAGE sql STABLE;
|
||||
`);
|
||||
})
|
||||
// POLICIES
|
||||
|
@ -1982,7 +1632,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
ALTER TABLE stashes_scenes ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE stashes_movies ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE stashes_actors ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE stashes_series ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY stashes_policy_select ON stashes FOR SELECT USING (stashes.public OR stashes.user_id = current_user_id());
|
||||
CREATE POLICY stashes_policy_update ON stashes FOR UPDATE USING (stashes.public OR stashes.user_id = current_user_id());
|
||||
|
@ -2013,14 +1662,6 @@ exports.up = (knex) => Promise.resolve()
|
|||
AND (stashes.user_id = current_user_id() OR stashes.public)
|
||||
));
|
||||
|
||||
CREATE POLICY stashes_policy ON stashes_series
|
||||
USING (EXISTS (
|
||||
SELECT *
|
||||
FROM stashes
|
||||
WHERE stashes.id = stashes_series.stash_id
|
||||
AND (stashes.user_id = current_user_id() OR stashes.public)
|
||||
));
|
||||
|
||||
ALTER TABLE alerts ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE alerts_tags ENABLE ROW LEVEL SECURITY;
|
||||
ALTER TABLE alerts_scenes ENABLE ROW LEVEL SECURITY;
|
||||
|
@ -2088,6 +1729,33 @@ exports.up = (knex) => Promise.resolve()
|
|||
`, {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
});
|
||||
})
|
||||
// VIEWS AND COMMENTS
|
||||
.then(() => { // eslint-disable-line arrow-body-style
|
||||
// allow vim fold
|
||||
return knex.raw(`
|
||||
COMMENT ON COLUMN users.password IS E'@omit';
|
||||
COMMENT ON COLUMN users.email IS E'@omit';
|
||||
COMMENT ON COLUMN users.email_verified IS E'@omit';
|
||||
COMMENT ON COLUMN users.abilities IS E'@omit';
|
||||
|
||||
COMMENT ON COLUMN actors.height IS E'@omit read,update,create,delete,all,many';
|
||||
COMMENT ON COLUMN actors.weight IS E'@omit read,update,create,delete,all,many';
|
||||
COMMENT ON COLUMN actors.penis_length IS E'@omit read,update,create,delete,all,many';
|
||||
COMMENT ON COLUMN actors.penis_girth IS E'@omit read,update,create,delete,all,many';
|
||||
|
||||
COMMENT ON FUNCTION actors_tags IS E'@sortable';
|
||||
COMMENT ON FUNCTION actors_channels IS E'@sortable';
|
||||
COMMENT ON FUNCTION actors_actors IS E'@sortable';
|
||||
COMMENT ON FUNCTION actors_scenes IS E'@sortable';
|
||||
COMMENT ON FUNCTION tags_scenes IS E'@sortable';
|
||||
|
||||
COMMENT ON FUNCTION search_releases IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_entities IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_actors IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_movies IS E'@sortable';
|
||||
COMMENT ON FUNCTION search_tags IS E'@sortable';
|
||||
`);
|
||||
});
|
||||
|
||||
exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||
|
@ -2108,17 +1776,8 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
|||
DROP TABLE IF EXISTS movies_scenes CASCADE;
|
||||
DROP TABLE IF EXISTS movies_covers CASCADE;
|
||||
DROP TABLE IF EXISTS movies_posters CASCADE;
|
||||
DROP TABLE IF EXISTS movies_photos CASCADE;
|
||||
DROP TABLE IF EXISTS movies_trailers CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS stashes_series CASCADE;
|
||||
DROP TABLE IF EXISTS series_scenes CASCADE;
|
||||
DROP TABLE IF EXISTS series_trailers CASCADE;
|
||||
DROP TABLE IF EXISTS series_posters CASCADE;
|
||||
DROP TABLE IF EXISTS series_covers CASCADE;
|
||||
DROP TABLE IF EXISTS series_photos CASCADE;
|
||||
DROP TABLE IF EXISTS series_search CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS clips_tags CASCADE;
|
||||
DROP TABLE IF EXISTS clips_posters CASCADE;
|
||||
DROP TABLE IF EXISTS clips_photos CASCADE;
|
||||
|
@ -2130,7 +1789,6 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
|||
DROP TABLE IF EXISTS banners_tags CASCADE;
|
||||
DROP TABLE IF EXISTS banners CASCADE;
|
||||
DROP TABLE IF EXISTS campaigns CASCADE;
|
||||
DROP TABLE IF EXISTS random_campaign CASCADE;
|
||||
DROP TABLE IF EXISTS affiliates CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS batches CASCADE;
|
||||
|
@ -2154,7 +1812,6 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
|||
DROP TABLE IF EXISTS movies CASCADE;
|
||||
DROP TABLE IF EXISTS clips CASCADE;
|
||||
DROP TABLE IF EXISTS chapters CASCADE;
|
||||
DROP TABLE IF EXISTS series CASCADE;
|
||||
DROP TABLE IF EXISTS releases CASCADE;
|
||||
DROP TABLE IF EXISTS actors CASCADE;
|
||||
DROP TABLE IF EXISTS tags CASCADE;
|
||||
|
@ -2196,9 +1853,6 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
|||
DROP FUNCTION IF EXISTS get_random_sfw_media_id;
|
||||
|
||||
DROP FUNCTION IF EXISTS releases_is_new;
|
||||
DROP FUNCTION IF EXISTS entities_scenes;
|
||||
DROP FUNCTION IF EXISTS entities_scene_total;
|
||||
DROP FUNCTION IF EXISTS entities_scene_tags;
|
||||
DROP FUNCTION IF EXISTS actors_tags;
|
||||
DROP FUNCTION IF EXISTS actors_channels;
|
||||
DROP FUNCTION IF EXISTS actors_actors;
|
||||
|
@ -2206,11 +1860,7 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
|||
|
||||
DROP FUNCTION IF EXISTS movies_actors;
|
||||
DROP FUNCTION IF EXISTS movies_tags;
|
||||
DROP FUNCTION IF EXISTS movies_scenes_photos;
|
||||
|
||||
DROP FUNCTION IF EXISTS series_actors;
|
||||
DROP FUNCTION IF EXISTS series_tags;
|
||||
DROP FUNCTION IF EXISTS series_scenes_photos;
|
||||
DROP FUNCTION IF EXISTS movies_photos;
|
||||
|
||||
DROP POLICY IF EXISTS stashes_policy ON stashes;
|
||||
DROP POLICY IF EXISTS stashes_policy ON stashes_scenes;
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE FUNCTION entities_scenes(entity entities) RETURNS SETOF releases AS $$
|
||||
WITH RECURSIVE children AS (
|
||||
SELECT entities.id
|
||||
FROM entities
|
||||
WHERE entities.id = entity.id
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT entities.id
|
||||
FROM entities
|
||||
INNER JOIN children ON children.id = entities.parent_id
|
||||
)
|
||||
|
||||
SELECT releases FROM releases
|
||||
INNER JOIN children ON children.id = releases.entity_id
|
||||
|
||||
UNION
|
||||
|
||||
SELECT releases FROM releases
|
||||
INNER JOIN children ON children.id = releases.studio_id;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
COMMENT ON FUNCTION entities_scenes IS E'@sortable';
|
||||
`);
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP FUNCTION IF EXISTS entities_scenes;
|
||||
`);
|
|
@ -0,0 +1,15 @@
|
|||
exports.up = async (knex) => Promise.resolve()
|
||||
.then(() => knex.schema.alterTable('releases_tags', (table) => {
|
||||
table.index('release_id');
|
||||
}))
|
||||
.then(() => knex.schema.alterTable('movies_scenes', (table) => {
|
||||
table.index('scene_id');
|
||||
}));
|
||||
|
||||
exports.down = async (knex) => Promise.resolve()
|
||||
.then(() => knex.schema.alterTable('releases_tags', (table) => {
|
||||
table.dropIndex('release_id');
|
||||
}))
|
||||
.then(() => knex.schema.alterTable('movies_scenes', (table) => {
|
||||
table.dropIndex('scene_id');
|
||||
}));
|
|
@ -0,0 +1,11 @@
|
|||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE OR REPLACE FUNCTION entities_scene_total(entity entities) RETURNS bigint AS $$
|
||||
SELECT COUNT(id)
|
||||
FROM releases
|
||||
WHERE releases.entity_id = entity.id;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`);
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP FUNCTION IF EXISTS entities_scene_total;
|
||||
`);
|
|
@ -0,0 +1,23 @@
|
|||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE FUNCTION entities_scene_tags(entity entities, selectable_tags text[]) RETURNS SETOF tags AS $$
|
||||
SELECT tags.*
|
||||
FROM releases
|
||||
LEFT JOIN
|
||||
releases_tags ON releases_tags.release_id = releases.id
|
||||
LEFT JOIN
|
||||
tags ON tags.id = releases_tags.tag_id
|
||||
WHERE
|
||||
releases.entity_id = entity.id
|
||||
AND
|
||||
CASE WHEN array_length(selectable_tags, 1) IS NOT NULL
|
||||
THEN tags.slug = ANY(selectable_tags)
|
||||
ELSE true
|
||||
END
|
||||
GROUP BY tags.id
|
||||
ORDER BY tags.name;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`);
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP FUNCTION IF EXISTS entities_scene_tags;
|
||||
`);
|
|
@ -0,0 +1,215 @@
|
|||
const config = require('config');
|
||||
|
||||
exports.up = async (knex) => Promise.resolve()
|
||||
.then(() => knex.schema.createTable('series', (table) => {
|
||||
table.increments('id', 16);
|
||||
|
||||
table.integer('entity_id', 12)
|
||||
.references('id')
|
||||
.inTable('entities')
|
||||
.notNullable();
|
||||
|
||||
table.integer('studio_id', 12)
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
|
||||
table.text('entry_id');
|
||||
table.unique(['entity_id', 'entry_id']);
|
||||
|
||||
table.text('url', 1000);
|
||||
table.text('title');
|
||||
table.text('slug');
|
||||
|
||||
table.timestamp('date');
|
||||
table.index('date');
|
||||
|
||||
table.enum('date_precision', ['year', 'month', 'week', 'day', 'hour', 'minute', 'second'])
|
||||
.defaultTo('day');
|
||||
|
||||
table.text('description');
|
||||
|
||||
table.boolean('deep');
|
||||
table.text('deep_url', 1000);
|
||||
|
||||
table.text('comment');
|
||||
|
||||
table.integer('created_batch_id', 12)
|
||||
.references('id')
|
||||
.inTable('batches')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('updated_batch_id', 12)
|
||||
.references('id')
|
||||
.inTable('batches')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_scenes', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('scene_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('releases')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.unique(['serie_id', 'scene_id']);
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_trailers', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.unique()
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_posters', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.unique('serie_id');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_covers', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['serie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_search', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('stashes_series', (table) => {
|
||||
table.integer('stash_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('stashes')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('serie_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.unique(['stash_id', 'serie_id']);
|
||||
|
||||
table.string('comment');
|
||||
|
||||
table.datetime('created_at')
|
||||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.raw(`
|
||||
ALTER TABLE series_search ADD COLUMN document tsvector;
|
||||
|
||||
CREATE UNIQUE INDEX series_search_unique ON series_search (serie_id);
|
||||
CREATE INDEX series_search_index ON series_search USING GIN (document);
|
||||
|
||||
CREATE FUNCTION series_actors(serie series) RETURNS SETOF actors AS $$
|
||||
SELECT actors.*
|
||||
FROM series_scenes
|
||||
LEFT JOIN
|
||||
releases ON releases.id = series_scenes.scene_id
|
||||
LEFT JOIN
|
||||
releases_actors ON releases_actors.release_id = releases.id
|
||||
LEFT JOIN
|
||||
actors ON actors.id = releases_actors.actor_id
|
||||
WHERE series_scenes.serie_id = serie.id
|
||||
AND actors.id IS NOT NULL
|
||||
GROUP BY actors.id
|
||||
ORDER BY actors.name, actors.gender
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION series_tags(serie series) RETURNS SETOF tags AS $$
|
||||
SELECT tags.*
|
||||
FROM series_scenes
|
||||
LEFT JOIN
|
||||
releases ON releases.id = series_scenes.scene_id
|
||||
LEFT JOIN
|
||||
releases_tags ON releases_tags.release_id = releases.id
|
||||
LEFT JOIN
|
||||
tags ON tags.id = releases_tags.tag_id
|
||||
WHERE series_scenes.serie_id = serie.id
|
||||
AND tags.id IS NOT NULL
|
||||
GROUP BY tags.id
|
||||
ORDER BY tags.priority DESC
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
CREATE FUNCTION series_photos(serie series) RETURNS SETOF media AS $$
|
||||
SELECT media.*
|
||||
FROM series_scenes
|
||||
LEFT JOIN
|
||||
releases ON releases.id = series_scenes.scene_id
|
||||
INNER JOIN
|
||||
releases_photos ON releases_photos.release_id = releases.id
|
||||
LEFT JOIN
|
||||
media ON media.id = releases_photos.media_id
|
||||
WHERE series_scenes.serie_id = serie.id
|
||||
GROUP BY media.id
|
||||
ORDER BY media.index ASC
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
GRANT ALL ON ALL TABLES IN SCHEMA public TO :visitor;
|
||||
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO :visitor;
|
||||
|
||||
ALTER TABLE stashes_series ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY stashes_policy ON stashes_series
|
||||
USING (EXISTS (
|
||||
SELECT *
|
||||
FROM stashes
|
||||
WHERE stashes.id = stashes_series.stash_id
|
||||
AND (stashes.user_id = current_user_id() OR stashes.public)
|
||||
));
|
||||
`, {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
}));
|
||||
|
||||
exports.down = async (knex) => Promise.resolve()
|
||||
.then(() => knex.raw(`
|
||||
DROP FUNCTION IF EXISTS series_actors;
|
||||
DROP FUNCTION IF EXISTS series_tags;
|
||||
DROP FUNCTION IF EXISTS series_photos;
|
||||
|
||||
DROP TABLE IF EXISTS stashes_series CASCADE;
|
||||
DROP TABLE IF EXISTS series_scenes CASCADE;
|
||||
DROP TABLE IF EXISTS series_trailers CASCADE;
|
||||
DROP TABLE IF EXISTS series_posters CASCADE;
|
||||
DROP TABLE IF EXISTS series_covers CASCADE;
|
||||
DROP TABLE IF EXISTS series_search CASCADE;
|
||||
DROP TABLE IF EXISTS series CASCADE;
|
||||
`));
|
|
@ -0,0 +1,49 @@
|
|||
const config = require('config');
|
||||
|
||||
exports.up = async (knex) => Promise.resolve()
|
||||
.then(() => knex.raw(`
|
||||
ALTER FUNCTION movies_photos(movie movies) RENAME TO movies_scenes_photos;
|
||||
ALTER FUNCTION series_photos(serie series) RENAME TO series_scenes_photos;
|
||||
`))
|
||||
.then(() => knex.schema.createTable('movies_photos', (table) => {
|
||||
table.integer('movie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('movies')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['movie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('series_photos', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['serie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.raw(`
|
||||
GRANT ALL ON ALL TABLES IN SCHEMA public TO :visitor;
|
||||
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO :visitor;
|
||||
`, {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
}));
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP TABLE IF EXISTS movies_photos CASCADE;
|
||||
DROP TABLE IF EXISTS series_photos CASCADE;
|
||||
|
||||
ALTER FUNCTION movies_scenes_photos(movie movies) RENAME TO movies_photos;
|
||||
ALTER FUNCTION series_scenes_photos(serie series) RENAME TO series_photos;
|
||||
`);
|
|
@ -0,0 +1,7 @@
|
|||
exports.up = async (knex) => knex.schema.alterTable('releases', (table) => {
|
||||
table.specificType('qualities', 'text[]');
|
||||
});
|
||||
|
||||
exports.down = async (knex) => knex.schema.alterTable('releases', (table) => {
|
||||
table.dropColumn('qualities');
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
exports.up = async (knex) => knex.schema.alterTable('users', (table) => {
|
||||
table.datetime('last_login');
|
||||
});
|
||||
|
||||
exports.down = async (knex) => knex.schema.alterTable('users', (table) => {
|
||||
table.dropColumn('last_login');
|
||||
});
|
|
@ -0,0 +1,58 @@
|
|||
exports.up = async (knex) => Promise.resolve()
|
||||
.then(() => knex.schema.createTable('random_campaign', (table) => {
|
||||
table.text('banner_id')
|
||||
.references('id')
|
||||
.inTable('banners');
|
||||
|
||||
table.text('url');
|
||||
|
||||
table.integer('entity_id')
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
|
||||
table.string('affiliate_id')
|
||||
.references('id')
|
||||
.inTable('affiliates');
|
||||
|
||||
table.integer('parent_id')
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
}))
|
||||
.then(() => knex.raw(`
|
||||
ALTER TABLE banners ADD COLUMN ratio numeric GENERATED ALWAYS AS (ROUND(width::decimal/ height::decimal, 2)) STORED;
|
||||
`))
|
||||
.then(() => knex.raw(`
|
||||
DROP FUNCTION IF EXISTS get_random_campaign;
|
||||
DROP FUNCTION IF EXISTS banners_ratio;
|
||||
|
||||
CREATE FUNCTION get_random_campaign(min_ratio decimal default 0, max_ratio decimal default 1000.0) RETURNS random_campaign AS $$
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT ON (CASE WHEN parent_id IS NOT NULL THEN parent_id ELSE entity_id END)
|
||||
banner_id, url, entity_id, affiliate_id, parent_id
|
||||
FROM (
|
||||
SELECT
|
||||
campaigns.*, entities.parent_id as parent_id
|
||||
FROM campaigns
|
||||
LEFT JOIN entities ON entities.id = campaigns.entity_id
|
||||
LEFT JOIN banners ON banners.id = campaigns.banner_id
|
||||
WHERE banner_id IS NOT NULL
|
||||
AND ratio >= min_ratio
|
||||
AND ratio <= max_ratio
|
||||
ORDER BY RANDOM()
|
||||
) random_campaigns
|
||||
) random_banners
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 1;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`));
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP FUNCTION IF EXISTS get_random_campaign;
|
||||
DROP TABLE IF EXISTS random_campaign;
|
||||
|
||||
ALTER TABLE banners DROP COLUMN ratio;
|
||||
|
||||
CREATE FUNCTION banners_ratio(banner banners) RETURNS numeric AS $$
|
||||
SELECT ROUND(banner.width::decimal / banner.height::decimal, 2);
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`);
|
|
@ -0,0 +1,8 @@
|
|||
exports.up = async (knex) => knex.schema.alterTable('entities', (table) => {
|
||||
table.boolean('showcased')
|
||||
.defaultTo(true);
|
||||
});
|
||||
|
||||
exports.down = async (knex) => knex.schema.alterTable('entities', (table) => {
|
||||
table.dropColumn('showcased');
|
||||
});
|
|
@ -0,0 +1,20 @@
|
|||
const config = require('config');
|
||||
|
||||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE VIEW releases_not_showcased AS (
|
||||
SELECT releases.id AS release_id FROM releases
|
||||
LEFT JOIN entities ON entities.id = releases.entity_id
|
||||
LEFT JOIN entities AS studios ON studios.id = releases.studio_id
|
||||
WHERE entities.showcased = false
|
||||
OR studios.showcased = false
|
||||
);
|
||||
|
||||
COMMENT ON VIEW releases_not_showcased IS E'@foreignKey (release_id) references releases (id)';
|
||||
GRANT SELECT ON releases_not_showcased TO :visitor;
|
||||
`, {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
});
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP VIEW IF EXISTS releases_not_showcased;
|
||||
`);
|
|
@ -1,58 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('random_campaign', (table) => {
|
||||
table.integer('id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('campaigns');
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
CREATE OR REPLACE FUNCTION get_random_campaign(min_ratio decimal default 0, max_ratio decimal default 1000.0) RETURNS random_campaign AS $$
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT ON (CASE WHEN parent_id IS NOT NULL THEN parent_id ELSE entity_id END)
|
||||
banner_id, url, entity_id, affiliate_id, parent_id, id
|
||||
FROM (
|
||||
SELECT
|
||||
campaigns.*, entities.parent_id as parent_id
|
||||
FROM campaigns
|
||||
LEFT JOIN entities ON entities.id = campaigns.entity_id
|
||||
LEFT JOIN banners ON banners.id = campaigns.banner_id
|
||||
WHERE banner_id IS NOT NULL
|
||||
AND ratio >= min_ratio
|
||||
AND ratio <= max_ratio
|
||||
ORDER BY RANDOM()
|
||||
) random_campaigns
|
||||
) random_banners
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 1;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('random_campaign', (table) => {
|
||||
table.dropColumn('campaign_id');
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
CREATE OR REPLACE FUNCTION get_random_campaign(min_ratio decimal default 0, max_ratio decimal default 1000.0) RETURNS random_campaign AS $$
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT ON (CASE WHEN parent_id IS NOT NULL THEN parent_id ELSE entity_id END)
|
||||
banner_id, url, entity_id, affiliate_id, parent_id
|
||||
FROM (
|
||||
SELECT
|
||||
campaigns.*, entities.parent_id as parent_id
|
||||
FROM campaigns
|
||||
LEFT JOIN entities ON entities.id = campaigns.entity_id
|
||||
LEFT JOIN banners ON banners.id = campaigns.banner_id
|
||||
WHERE banner_id IS NOT NULL
|
||||
AND ratio >= min_ratio
|
||||
AND ratio <= max_ratio
|
||||
ORDER BY RANDOM()
|
||||
) random_campaigns
|
||||
) random_banners
|
||||
ORDER BY RANDOM()
|
||||
LIMIT 1;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
`);
|
||||
};
|
|
@ -1,47 +0,0 @@
|
|||
const config = require('config');
|
||||
|
||||
exports.up = async (knex) => {
|
||||
await knex.raw(`
|
||||
CREATE MATERIALIZED VIEW releases_summaries AS (
|
||||
SELECT
|
||||
releases.id as release_id,
|
||||
channels.slug as channel_slug,
|
||||
channels.type as channel_type,
|
||||
networks.slug as network_slug,
|
||||
networks.type as network_type,
|
||||
parent_networks.slug as parent_network_slug,
|
||||
parent_networks.type as parent_network_type,
|
||||
studios.showcased IS NOT false
|
||||
AND (channels.showcased IS NOT false OR COALESCE(studios.showcased, false) = true)
|
||||
AND (networks.showcased IS NOT false OR COALESCE(channels.showcased, false) = true OR COALESCE(studios.showcased, false) = true)
|
||||
AS showcased,
|
||||
batches.showcased AS batch_showcased,
|
||||
releases.effective_date,
|
||||
releases.created_at,
|
||||
array_agg(tags.slug ORDER BY tags.priority DESC) FILTER (WHERE tags.slug IS NOT NULL) AS tags
|
||||
FROM releases
|
||||
LEFT JOIN releases_tags ON releases_tags.release_id = releases.id
|
||||
LEFT JOIN tags ON tags.id = releases_tags.tag_id
|
||||
LEFT JOIN entities AS channels ON channels.id = releases.entity_id
|
||||
LEFT JOIN entities AS studios ON studios.id = releases.studio_id
|
||||
LEFT JOIN entities AS networks ON networks.id = channels.parent_id
|
||||
LEFT JOIN entities AS parent_networks ON parent_networks.id = networks.parent_id
|
||||
LEFT JOIN batches ON batches.id = releases.updated_batch_id
|
||||
GROUP BY releases.id, studios.showcased, batches.showcased,
|
||||
channels.showcased, channels.slug, channels.type,
|
||||
networks.showcased, networks.slug, networks.type,
|
||||
parent_networks.slug, parent_networks.type
|
||||
);
|
||||
|
||||
COMMENT ON MATERIALIZED VIEW releases_summaries IS E'@foreignKey (release_id) references releases (id)';
|
||||
GRANT ALL ON releases_summaries TO :visitor;
|
||||
`, {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.raw(`
|
||||
DROP MATERIALIZED VIEW IF EXISTS releases_summaries;
|
||||
`);
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('actors_social', (table) => {
|
||||
table.integer('profile_id')
|
||||
.references('id')
|
||||
.inTable('actors_profiles');
|
||||
|
||||
table.dropUnique(['url', 'actor_id']);
|
||||
table.unique(['url', 'actor_id', 'profile_id']);
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
CREATE UNIQUE INDEX actors_social_url_actor_id_null_unique ON actors_social (url, actor_id) WHERE profile_id IS NULL;
|
||||
`);
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.raw(`
|
||||
DROP INDEX actors_social_url_actor_id_null_unique;
|
||||
`);
|
||||
|
||||
await knex.schema.alterTable('actors_social', (table) => {
|
||||
table.dropUnique(['url', 'actor_id', 'profile_id']);
|
||||
table.unique(['url', 'actor_id']);
|
||||
|
||||
table.dropColumn('profile_id');
|
||||
});
|
||||
};
|
|
@ -1,24 +0,0 @@
|
|||
const config = require('config');
|
||||
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.createTable('releases_caps', (table) => {
|
||||
table.integer('release_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('releases')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
});
|
||||
|
||||
await knex.raw('GRANT ALL ON releases_caps TO :visitor;', {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.dropTable('releases_caps');
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('actors_profiles', (table) => {
|
||||
table.string('hair_type');
|
||||
table.decimal('shoe_size');
|
||||
table.string('blood_type');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('actors', (table) => {
|
||||
table.string('hair_type');
|
||||
table.decimal('shoe_size');
|
||||
table.string('blood_type');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('actors_profiles', (table) => {
|
||||
table.dropColumn('hair_type');
|
||||
table.dropColumn('shoe_size');
|
||||
table.dropColumn('blood_type');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('actors', (table) => {
|
||||
table.dropColumn('hair_type');
|
||||
table.dropColumn('shoe_size');
|
||||
table.dropColumn('blood_type');
|
||||
});
|
||||
};
|
|
@ -1,13 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('batches', (table) => {
|
||||
table.boolean('showcased')
|
||||
.notNullable()
|
||||
.defaultTo(true);
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('batches', (table) => {
|
||||
table.dropColumn('showcased');
|
||||
});
|
||||
};
|
|
@ -1,27 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('releases', (table) => {
|
||||
table.specificType('alt_titles', 'text ARRAY');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('movies', (table) => {
|
||||
table.specificType('alt_titles', 'text ARRAY');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('series', (table) => {
|
||||
table.specificType('alt_titles', 'text ARRAY');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('releases', (table) => {
|
||||
table.dropColumn('alt_titles');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('movies', (table) => {
|
||||
table.dropColumn('alt_titles');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('series', (table) => {
|
||||
table.dropColumn('alt_titles');
|
||||
});
|
||||
};
|
|
@ -1,36 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.createTable('movies_teasers', (table) => {
|
||||
table.integer('movie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('movies')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique('movie_id');
|
||||
});
|
||||
|
||||
await knex.schema.createTable('series_teasers', (table) => {
|
||||
table.integer('serie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('series')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique('serie_id');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.dropTable('movies_teasers');
|
||||
await knex.schema.dropTable('series_teasers');
|
||||
};
|
|
@ -1,19 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('releases', (table) => {
|
||||
table.integer('photo_count');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('movies', (table) => {
|
||||
table.integer('photo_count');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('releases', (table) => {
|
||||
table.dropColumn('photo_count');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('movies', (table) => {
|
||||
table.dropColumn('photo_count');
|
||||
});
|
||||
};
|
|
@ -1,42 +0,0 @@
|
|||
const config = require('config');
|
||||
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('alerts', (table) => {
|
||||
table.boolean('all')
|
||||
.defaultTo(true);
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('alerts_entities', (table) => {
|
||||
table.dropUnique('alert_id');
|
||||
});
|
||||
|
||||
await knex.schema.createTable('alerts_matches', (table) => {
|
||||
table.increments('id');
|
||||
|
||||
table.integer('alert_id')
|
||||
.references('id')
|
||||
.inTable('alerts')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.string('property');
|
||||
table.string('expression');
|
||||
});
|
||||
|
||||
await knex.raw(`
|
||||
GRANT SELECT ON alerts_matches TO :visitor;
|
||||
`, {
|
||||
visitor: knex.raw(config.database.query.user),
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('alerts', (table) => {
|
||||
table.dropColumn('all');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('alerts_entities', (table) => {
|
||||
table.unique('alert_id');
|
||||
});
|
||||
|
||||
await knex.schema.dropTable('alerts_matches');
|
||||
};
|
|
@ -0,0 +1,25 @@
|
|||
exports.up = async (knex) => knex.raw(`
|
||||
CREATE MATERIALIZED VIEW entities_stats
|
||||
AS
|
||||
WITH RECURSIVE relations AS (
|
||||
SELECT entities.id, entities.parent_id, count(releases.id) AS releases_count, count(releases.id) AS total_count
|
||||
FROM entities
|
||||
LEFT JOIN releases ON releases.entity_id = entities.id
|
||||
GROUP BY entities.id
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT entities.id AS entity_id, count(releases.id) AS releases_count, count(releases.id) + relations.total_count AS total_count
|
||||
FROM entities
|
||||
INNER JOIN relations ON relations.id = entities.parent_id
|
||||
LEFT JOIN releases ON releases.entity_id = entities.id
|
||||
GROUP BY entities.id
|
||||
)
|
||||
|
||||
SELECT relations.id AS entity_id, relations.releases_count
|
||||
FROM relations;
|
||||
`);
|
||||
|
||||
exports.down = async (knex) => knex.raw(`
|
||||
DROP MATERIALIZED VIEW entities_stats;
|
||||
`);
|
|
@ -1,11 +0,0 @@
|
|||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('banners', (table) => {
|
||||
table.text('html');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('banners', (table) => {
|
||||
table.dropColumn('html');
|
||||
});
|
||||
};
|
16
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.233.0",
|
||||
"version": "1.225.10",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
@ -91,11 +91,9 @@
|
|||
"convert": "^4.2.4",
|
||||
"cookie": "^0.4.0",
|
||||
"csv-stringify": "^5.3.6",
|
||||
"date-fns": "^2.30.0",
|
||||
"dayjs": "^1.8.21",
|
||||
"dompurify": "^2.0.11",
|
||||
"ejs": "^3.0.1",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"express": "^4.17.1",
|
||||
"express-promise-router": "^4.1.0",
|
||||
"express-react-views": "^0.11.0",
|
||||
|
@ -115,23 +113,21 @@
|
|||
"knex": "^0.95.12",
|
||||
"knex-migrate": "^1.7.4",
|
||||
"longjohn": "^0.2.12",
|
||||
"merge-anything": "^5.1.7",
|
||||
"mime": "^2.4.4",
|
||||
"mitt": "^3.0.0",
|
||||
"moment": "^2.24.0",
|
||||
"nanoid": "^3.1.30",
|
||||
"node-fetch": "^2.6.7",
|
||||
"object-merge-advanced": "^12.1.0",
|
||||
"object.omit": "^3.0.0",
|
||||
"opn": "^6.0.0",
|
||||
"pg": "^8.5.1",
|
||||
"postgraphile": "^4.13.0",
|
||||
"postgraphile-plugin-connection-filter": "^2.2.2",
|
||||
"promise-task-queue": "^1.2.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"puppeteer": "^20.5.0",
|
||||
"puppeteer-extra": "^3.3.6",
|
||||
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
||||
"redis": "^4.6.7",
|
||||
"puppeteer": "^18.2.0",
|
||||
"puppeteer-extra": "^3.3.4",
|
||||
"puppeteer-extra-plugin-stealth": "^2.11.1",
|
||||
"sharp": "^0.29.2",
|
||||
"showdown": "^1.9.1",
|
||||
"source-map-support": "^0.5.16",
|
||||
|
@ -141,7 +137,7 @@
|
|||
"tunnel": "0.0.6",
|
||||
"ua-parser-js": "^1.0.32",
|
||||
"undici": "^4.13.0",
|
||||
"unprint": "^0.10.11",
|
||||
"unprint": "^0.8.2",
|
||||
"url-pattern": "^1.0.3",
|
||||
"v-tooltip": "^2.0.3",
|
||||
"video.js": "^7.11.4",
|
||||
|
|
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 98 KiB |
|
@ -1 +0,0 @@
|
|||
<iframe style="background-color: white;" width="300" height="100" scrolling="no" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" name="spot_id_10002480" src="//a.adtng.com/get/10002480?ata=DebaucheryLibrarian"></iframe>
|
|
@ -1 +0,0 @@
|
|||
<iframe style="background-color: white;" width="300" height="250" scrolling="no" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" name="spot_id_10001807" src="//a.adtng.com/get/10001807?ata=DebaucheryLibrarian"></iframe>
|
|
@ -1 +0,0 @@
|
|||
<iframe style="background-color: white;" width="315" height="300" scrolling="no" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" name="spot_id_10002484" src="//a.adtng.com/get/10002484?ata=DebaucheryLibrarian"></iframe>
|
|
@ -1 +0,0 @@
|
|||
<iframe style="background-color: white;" width="728" height="90" scrolling="no" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" name="spot_id_10002481" src="//a.adtng.com/get/10002481?ata=DebaucheryLibrarian"></iframe>
|
|
@ -1 +0,0 @@
|
|||
<iframe style="background-color: white;" width="728" height="90" scrolling="no" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" name="spot_id_10002466" src="//a.adtng.com/get/10002466?ata=DebaucheryLibrarian"></iframe>
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |