Compare commits

...

154 Commits

Author SHA1 Message Date
DebaucheryLibrarian 2783de5272 1.228.33 2023-07-09 21:39:44 +02:00
DebaucheryLibrarian 77727dff77 Added MariskaX. 2023-07-09 21:39:40 +02:00
DebaucheryLibrarian f009c90e5d Updated Blowpass seed entries. 2023-07-09 05:23:17 +02:00
DebaucheryLibrarian f4cb4ca26a 1.228.32 2023-07-09 05:08:37 +02:00
DebaucheryLibrarian 1cba51fbfd Moved Blowpass to Gamma API. 2023-07-09 05:08:35 +02:00
DebaucheryLibrarian c5d9b93263 1.228.31 2023-07-09 04:35:33 +02:00
DebaucheryLibrarian 88a56794aa Separated Filthy Kings into its channels, upgraded Gamma scraper to accomodate. 2023-07-09 04:35:30 +02:00
DebaucheryLibrarian c51577098a Added Milfy to proxy list. 2023-07-07 03:52:10 +02:00
DebaucheryLibrarian 3dff352399 1.228.30 2023-07-07 03:43:22 +02:00
DebaucheryLibrarian 6cb48647a8 Updated deepthroat tag photo. 2023-07-07 03:43:16 +02:00
DebaucheryLibrarian d6c6c3435d 1.228.29 2023-07-07 02:20:09 +02:00
DebaucheryLibrarian 6f4608ba23 Using better video API for Vixen deep scrape. 2023-07-07 02:20:07 +02:00
DebaucheryLibrarian 10ba67fde1 1.228.28 2023-07-07 00:23:04 +02:00
DebaucheryLibrarian 83e22813f3 Using more aggressive optional chaining in Vixen scraper to prevent errors. 2023-07-07 00:23:02 +02:00
DebaucheryLibrarian f8e7ace89f Removed superfluous console logs. 2023-07-06 05:40:23 +02:00
DebaucheryLibrarian 8bb46c5a6d Moved missing slug return in Vixen scraper. 2023-07-06 05:30:51 +02:00
DebaucheryLibrarian 6e79112f3a 1.228.27 2023-07-06 05:09:08 +02:00
DebaucheryLibrarian 51e04e7331 Updated Jules Jordan profile scraper. 2023-07-06 05:09:05 +02:00
DebaucheryLibrarian 9331c0af52 1.228.26 2023-07-06 04:24:51 +02:00
DebaucheryLibrarian 18744372b3 Updated Vixen scraper with more informative API query. 2023-07-06 04:24:47 +02:00
DebaucheryLibrarian 43d8b93953 1.228.25 2023-07-06 00:42:14 +02:00
DebaucheryLibrarian b0c0b1a792 Reserving campaign space on actor, entity and tag pages. 2023-07-06 00:42:12 +02:00
DebaucheryLibrarian 717f07a09a 1.228.24 2023-07-06 00:30:06 +02:00
DebaucheryLibrarian f6c1910be3 Added media attempt configuration, default from 3 to 2, 1 for JJ scraper. 2023-07-06 00:30:04 +02:00
DebaucheryLibrarian a6077599bb 1.228.23 2023-07-06 00:14:42 +02:00
DebaucheryLibrarian 0905847ffa Updated Jules Jordan scraper. 2023-07-06 00:14:38 +02:00
DebaucheryLibrarian 66439b3b17 1.228.22 2023-07-03 00:50:50 +02:00
DebaucheryLibrarian 916deff487 Fixed Arch Angel placeholder thumbnail. 2023-07-03 00:50:47 +02:00
DebaucheryLibrarian 05788c2ed6 1.228.21 2023-07-02 23:59:51 +02:00
DebaucheryLibrarian 13d02a44e5 Fixed failed hash duplicate source breaking media association. 2023-07-02 23:59:49 +02:00
DebaucheryLibrarian a2ff12a636 1.228.20 2023-07-02 22:21:21 +02:00
DebaucheryLibrarian 0a27e91de7 Using effective date in all queries. 2023-07-02 22:21:19 +02:00
DebaucheryLibrarian 3c8b6e6fc1 1.228.19 2023-07-02 21:06:42 +02:00
DebaucheryLibrarian 61c84e18e4 Added separate force media argument. 2023-07-02 21:06:38 +02:00
DebaucheryLibrarian a858b2409a 1.228.18 2023-07-02 05:17:30 +02:00
DebaucheryLibrarian bb204f3d85 Disabled Arch Angel campaigns until NATS license is reactivated. 2023-07-02 05:17:27 +02:00
DebaucheryLibrarian 38ce9c84ba 1.228.17 2023-07-02 05:13:43 +02:00
DebaucheryLibrarian 57a8b8e2f6 Added setting to disable campaigns. 2023-07-02 05:13:40 +02:00
DebaucheryLibrarian 4a3674feac Added dedicated Arch Angel scraper. 2023-07-02 05:07:38 +02:00
DebaucheryLibrarian e22dbb315e 1.228.16 2023-07-02 01:04:41 +02:00
DebaucheryLibrarian a339c096ef Fixed Kink trailer query. 2023-07-02 01:04:39 +02:00
DebaucheryLibrarian a8fa1f36f8 Added Van Styles to Jules Jordan tag directors. 2023-07-01 22:45:28 +02:00
DebaucheryLibrarian 6edd587a33 1.228.15 2023-07-01 22:24:23 +02:00
DebaucheryLibrarian a2331bc913 Added prefer option for entity resolution. Merged migrations. 2023-07-01 22:24:21 +02:00
DebaucheryLibrarian 744bdb3170 1.228.14 2023-07-01 21:53:03 +02:00
DebaucheryLibrarian aa9e3b3d1f Deriving Jules Jordan director from tags. 2023-07-01 21:53:01 +02:00
DebaucheryLibrarian 99f2faa328 1.228.13 2023-07-01 21:46:47 +02:00
DebaucheryLibrarian 205102ff90 Added Meiden van Holland and Vurig Vlaanderen. 2023-07-01 21:46:44 +02:00
DebaucheryLibrarian 01b3cc42af 1.228.12 2023-06-24 22:30:58 +02:00
DebaucheryLibrarian 6de6053eaa Added page title function for Composition API components. 2023-06-24 22:30:55 +02:00
DebaucheryLibrarian fdad61465c 1.228.11 2023-06-24 17:32:55 +02:00
DebaucheryLibrarian 49a08cd576 Using time distance for content updated on stats page. 2023-06-24 17:32:53 +02:00
DebaucheryLibrarian 60c4f6e6c1 1.228.10 2023-06-24 17:23:44 +02:00
DebaucheryLibrarian 57e7710f25 Using locale numbers for stats page. 2023-06-24 17:23:42 +02:00
DebaucheryLibrarian e41d1e1ad2 1.228.9 2023-06-24 17:16:10 +02:00
DebaucheryLibrarian fbcf17d1c4 Refactored stats page. 2023-06-24 17:16:06 +02:00
DebaucheryLibrarian f4ed4fb8d8 1.228.8 2023-06-22 01:31:39 +02:00
DebaucheryLibrarian 25a90dd52c Moved Dogfart to DFXtra. 2023-06-22 01:31:36 +02:00
DebaucheryLibrarian ed92919c0d 1.228.7 2023-06-19 05:19:51 +02:00
DebaucheryLibrarian b5309005e9 Using affiliate parameters for Bang, fixed affiliate URL composition on entity page. 2023-06-19 05:19:49 +02:00
DebaucheryLibrarian 54c501e277 Added Bang affiliate link. 2023-06-19 05:11:27 +02:00
DebaucheryLibrarian f36d0686a1 1.228.6 2023-06-19 03:56:07 +02:00
DebaucheryLibrarian d6b44615a0 Allow HTML in disclaimer and announcement. 2023-06-19 03:56:05 +02:00
DebaucheryLibrarian 687d4aec08 1.228.5 2023-06-19 03:28:57 +02:00
DebaucheryLibrarian 18f75595da Added GraphiQL disable. 2023-06-19 03:28:55 +02:00
DebaucheryLibrarian 123d4155b4 1.228.4 2023-06-19 02:51:05 +02:00
DebaucheryLibrarian b362f95790 Added pm2 ecosystem file. 2023-06-19 02:51:01 +02:00
DebaucheryLibrarian 34613a92c5 1.228.3 2023-06-19 01:45:47 +02:00
DebaucheryLibrarian 1766556c49 Added query timeout setting. 2023-06-19 01:45:45 +02:00
DebaucheryLibrarian 6bf7fc5655 1.228.2 2023-06-19 01:36:06 +02:00
DebaucheryLibrarian 7bfb08f524 Added header notice, 2023-06-19 01:36:04 +02:00
DebaucheryLibrarian c4e77acdee 1.228.1 2023-06-19 01:25:33 +02:00
DebaucheryLibrarian 67c1bc6b1c Selecting parent and grantparent networks in entity releases filter. 2023-06-19 01:25:31 +02:00
DebaucheryLibrarian 4e6b098448 1.228.0 2023-06-19 00:39:03 +02:00
DebaucheryLibrarian dbaddfb291 Merged database migrations. 2023-06-19 00:39:00 +02:00
DebaucheryLibrarian 85942c5d00 1.227.18 2023-06-18 02:29:12 +02:00
DebaucheryLibrarian fe460f7441 Querying entity scenes from top level. 2023-06-18 02:29:10 +02:00
DebaucheryLibrarian 67365507b5 1.227.17 2023-06-18 02:12:14 +02:00
DebaucheryLibrarian 87a29baf8b Added stream ignore option. 2023-06-18 02:12:13 +02:00
DebaucheryLibrarian 2f4ac4e427 Removed default showcasing from entity showcase migration. 2023-06-17 23:33:15 +02:00
DebaucheryLibrarian 0056780dc4 1.227.16 2023-06-17 23:31:12 +02:00
DebaucheryLibrarian 013675d102 Improved showcase query. 2023-06-17 23:31:09 +02:00
DebaucheryLibrarian 236d4a9427 Fixed showcased not inserted in networks seed file. 2023-06-16 03:18:40 +02:00
DebaucheryLibrarian 22512833da Dsiabled showcase for entirey Nebraska Coeds network. 2023-06-16 03:17:03 +02:00
DebaucheryLibrarian dc231527f3 Disabled showcase for Nebraska Coeds. 2023-06-16 03:14:38 +02:00
DebaucheryLibrarian d4b0f2dc67 1.227.15 2023-06-16 02:29:03 +02:00
DebaucheryLibrarian 7723b2b698 Only curating release ID when present. 2023-06-16 02:29:01 +02:00
DebaucheryLibrarian 682f299c8f Added Milfy to Vixen. 2023-06-16 02:12:31 +02:00
DebaucheryLibrarian c43bef544e 1.227.14 2023-06-16 00:47:23 +02:00
DebaucheryLibrarian c4424f30ec Restored 'new' label client-side. 2023-06-16 00:47:19 +02:00
DebaucheryLibrarian 078837f276 1.227.13 2023-06-16 00:20:28 +02:00
DebaucheryLibrarian 6534692b73 Improved search efficiency. 2023-06-16 00:20:24 +02:00
DebaucheryLibrarian 20f82c4006 1.227.12 2023-06-15 19:53:44 +02:00
DebaucheryLibrarian 128f9950ec Prefer HTML over data titles for capitalization in Bang scraper. 2023-06-15 19:53:42 +02:00
DebaucheryLibrarian c2c329e00a 1.227.11 2023-06-15 16:56:30 +02:00
DebaucheryLibrarian 5d3358ed91 Decoding HTML entities in title, description and location. 2023-06-15 16:56:27 +02:00
DebaucheryLibrarian d7f9157424 1.227.10 2023-06-12 01:43:48 +02:00
DebaucheryLibrarian f464563dae Added index on release tags table and temporarily removed 'new' label for performance. 2023-06-12 01:43:43 +02:00
DebaucheryLibrarian 828db2a8c8 1.227.9 2023-06-11 02:38:04 +02:00
DebaucheryLibrarian bca865068a Fixed upcoming date sorting. 2023-06-11 02:38:02 +02:00
DebaucheryLibrarian 35245ca03f 1.227.8 2023-06-11 01:17:39 +02:00
DebaucheryLibrarian bcc183d5b9 Using native stream promises for media stream retrieval. 2023-06-11 01:17:37 +02:00
DebaucheryLibrarian 433498eaed 1.227.7 2023-06-10 02:06:02 +02:00
DebaucheryLibrarian 80334843c9 Improved puppeteer bypass, enabled for Team Skeet. 2023-06-10 02:05:59 +02:00
DebaucheryLibrarian 09a48ed064 1.227.6 2023-06-10 00:46:41 +02:00
DebaucheryLibrarian bae51dd59c Fixed poster query for old New Sensations scenes. 2023-06-10 00:46:38 +02:00
DebaucheryLibrarian 58175dce21 1.227.5 2023-06-09 00:33:42 +02:00
DebaucheryLibrarian c4e4f649f5 Fixed New Sensations classic scraper breaking on missing actors. 2023-06-09 00:33:40 +02:00
DebaucheryLibrarian bcd3c08faa Simplified stash routing. 2023-06-08 04:23:54 +02:00
DebaucheryLibrarian 0e656ea5ca 1.227.4 2023-06-08 04:19:40 +02:00
DebaucheryLibrarian d847c58d24 Changed stash routing. 2023-06-08 04:19:37 +02:00
DebaucheryLibrarian 81f504f33e 1.227.3 2023-06-08 03:57:53 +02:00
DebaucheryLibrarian 914838e367 Curating usernames in sign-up and stash load tool. 2023-06-08 03:57:50 +02:00
DebaucheryLibrarian 1fc441670b Reduced stash load verbosity. 2023-06-08 03:48:29 +02:00
DebaucheryLibrarian a16ca716da Warn instead of error when stash import user does not exist. 2023-06-08 03:42:26 +02:00
DebaucheryLibrarian d0b19752e1 1.227.2 2023-06-08 03:22:48 +02:00
DebaucheryLibrarian 9c63b31dfa Fixed alert tool to transfer combinations. 2023-06-08 03:22:46 +02:00
DebaucheryLibrarian 9bdd3ff2f3 Added alert transfer tools to repo. 2023-06-08 02:37:39 +02:00
DebaucheryLibrarian 4429169166 1.227.1 2023-06-08 02:36:50 +02:00
DebaucheryLibrarian 3dbb74a1dc Added alert transfer tools. Removed stash and alert add-tiles in favor of more prominent heading buttons. 2023-06-08 02:36:47 +02:00
DebaucheryLibrarian e7b72f5e99 Added filename to stash save. 2023-06-08 01:39:44 +02:00
DebaucheryLibrarian 5576fed590 Fixed existing stash selection in transfer tool. 2023-06-08 01:37:27 +02:00
DebaucheryLibrarian aa0fd3cf48 1.227.0 2023-06-08 01:16:48 +02:00
DebaucheryLibrarian 56534800d8 Added stash transfer tool. 2023-06-08 01:16:44 +02:00
DebaucheryLibrarian f7708e0740 1.226.11 2023-06-05 04:49:46 +02:00
DebaucheryLibrarian e36ba59d27 Auto-recognizing m3u8 sources as stream. Fixed Bang Bros poster and trailer. 2023-06-05 04:49:44 +02:00
DebaucheryLibrarian a99cee38a0 1.226.10 2023-06-05 03:32:28 +02:00
DebaucheryLibrarian d3da2359de Refactored Bang! scraper, added My Stepdaughters Friend. 2023-06-05 03:32:24 +02:00
DebaucheryLibrarian adda78f0c6 Refactored New Sensations scraper. 2023-06-05 02:13:36 +02:00
DebaucheryLibrarian 164757ee26 Matching URLs to entity using hostname rather than slug to minimize collisions. Fixed missing Cum Louder POV logo. 2023-06-04 21:50:59 +02:00
DebaucheryLibrarian 7e2840a00d 1.226.9 2023-06-04 04:17:06 +02:00
DebaucheryLibrarian caf37ba9fb Transferring release media types separately to prevent race conditions. 2023-06-04 04:17:01 +02:00
DebaucheryLibrarian 042d3be4a9 1.226.8 2023-06-04 01:24:20 +02:00
DebaucheryLibrarian 18e91d54f1 Transfer tool finds existing media by source. 2023-06-04 01:24:18 +02:00
DebaucheryLibrarian 84c59bd05a Removed redundant description replace in transfer tool. 2023-06-04 01:20:38 +02:00
DebaucheryLibrarian e0f7db8187 Improved skipped scene reporting in transfer tool. 2023-06-04 01:13:23 +02:00
DebaucheryLibrarian 13e38c487f Ignoring skipped scenes in final tally. 2023-06-04 01:05:59 +02:00
DebaucheryLibrarian 5b6911fd5c 1.226.7 2023-06-04 01:04:23 +02:00
DebaucheryLibrarian 33cab26d3b Fixed transfer status, moved media logging to debug level. 2023-06-04 01:04:21 +02:00
DebaucheryLibrarian c9201430ea Logging index in transfer. 2023-06-04 00:58:35 +02:00
DebaucheryLibrarian 48eeac6d88 1.226.6 2023-06-04 00:49:23 +02:00
DebaucheryLibrarian a4c82a377b Returning existing release ID in case new scene for existing movie was encountered. 2023-06-04 00:49:21 +02:00
DebaucheryLibrarian 421e8d0763 1.226.5 2023-06-04 00:42:31 +02:00
DebaucheryLibrarian 66f4244779 Logging skipped releases. 2023-06-04 00:42:29 +02:00
DebaucheryLibrarian 7fb832028e 1.226.4 2023-06-04 00:23:47 +02:00
DebaucheryLibrarian 54798f87da Improved duplicate media handling in transfer tool. 2023-06-04 00:23:45 +02:00
DebaucheryLibrarian 5ad5708e15 1.226.3 2023-06-03 22:41:18 +02:00
DebaucheryLibrarian f356135722 Using line-separated JSON to save memory in transfer tool. 2023-06-03 22:41:15 +02:00
DebaucheryLibrarian f3abc21482 1.226.2 2023-06-03 21:51:12 +02:00
DebaucheryLibrarian 5103a07e5f Accumulating boolean instead of full scene. 2023-06-03 21:51:09 +02:00
DebaucheryLibrarian 3fc63b1934 1.226.1 2023-06-03 02:51:45 +02:00
DebaucheryLibrarian 4b9a0e6bab Extended and improved transfer tool. Moved scenes up on movie page. 2023-06-03 02:51:42 +02:00
DebaucheryLibrarian 62617ec6bf 1.226.0 2023-05-31 00:30:00 +02:00
DebaucheryLibrarian 1b4d973e7b Added transfer tool, WIP. Added Savage Gangbang to Kink. 2023-05-31 00:29:54 +02:00
1220 changed files with 22800 additions and 2013 deletions

3
.gitignore vendored
View File

@ -10,6 +10,9 @@ config/*
!config/default.js
assets/js/config/
!assets/js/config/default.js
/export*
/stashes*
/alerts*
*.heapprofile
*.heapsnapshot
.vscode

View File

@ -65,6 +65,7 @@
</a>
<ul class="bio nolist">
<!-- probably not a good idea
<li
v-if="actor.realName"
class="bio-item"
@ -72,6 +73,7 @@
<dfn class="bio-label"><Icon icon="vcard" />Real name</dfn>
<span class="bio-value">{{ actor.realName }}</span>
</li>
-->
<li
v-if="actor.dateOfBirth"
@ -109,6 +111,15 @@
>{{ 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"
@ -294,7 +305,7 @@
class="description"
>
{{ description.text }}
<router-link :to="`/${description.entity.type}/${description.entity.slug}`">
<RouterLink :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`"
@ -306,7 +317,7 @@
:src="`/img/logos/${description.entity.parent.slug}/thumbs/${description.entity.slug}.png`"
class="description-logo"
>
</router-link>
</RouterLink>
</p>
</div>
</div>
@ -380,6 +391,8 @@
</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';
@ -471,7 +484,7 @@ export default {
releases: null,
done: false,
totalCount: 0,
limit: 20,
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
pageTitle: null,
bioExpanded: false,
photosExpanded: false,
@ -685,7 +698,8 @@ export default {
.ethnicity,
.hair,
.eyes {
.eyes,
.orientation {
text-transform: capitalize;
}

View File

@ -67,21 +67,21 @@
v-show="(!stash || stash.primary) && favorited"
icon="heart7"
class="stash stashed"
@click.prevent.native="unstashActor"
@click.stop.native="unstashActor"
/>
<Icon
v-show="(!stash || stash.primary) && favorited === false"
icon="heart8"
class="stash unstashed"
@click.prevent.native="stashActor"
@click.stop.native="stashActor"
/>
<Icon
v-show="stash && !stash.primary"
icon="cross2"
class="stash unstash"
@click.prevent.native="unstashActor"
@click.stop.native="unstashActor"
/>
<span class="details">

View File

@ -1,21 +1,23 @@
<template>
<iframe
v-if="campaign?.banner?.type === 'html'"
:width="campaign.banner.width"
:height="campaign.banner.height"
:src="getSource(campaign)"
scrolling="none"
marginwidth="0"
marginheight="0"
class="campaign frame"
/>
<a
v-if="campaign"
v-else-if="campaign"
:href="campaign.url || campaign.affiliate?.url"
target="_blank"
class="campaign"
>
<img
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'}`"
:src="getSource(campaign)"
:width="campaign.banner.width"
:height="campaign.banner.height"
class="campaign-banner"
@ -37,6 +39,12 @@ function ratioFilter(banner) {
return false;
}
if (banner.type === 'html' && banner.width > window.innerWidth) {
// usually non-scalable iframes
console.log('TOO WIDE');
return false;
}
if (this.minRatio && banner.ratio < this.minRatio) {
return false;
}
@ -48,6 +56,18 @@ 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))
@ -63,6 +83,10 @@ function entityCampaign() {
return randomCampaign;
}
if (this.allowGeneric) {
return this.genericCampaign();
}
this.$emit('campaign', null);
return null;
@ -84,6 +108,10 @@ function tagCampaign() {
return randomCampaign;
}
if (this.allowGeneric) {
return this.genericCampaign();
}
this.$emit('campaign', null);
return null;
@ -98,7 +126,21 @@ 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;
@ -134,6 +176,10 @@ export default {
type: Number,
default: null,
},
allowGeneric: {
type: Boolean,
default: false,
},
maxRatio: {
type: Number,
default: null,
@ -149,7 +195,9 @@ export default {
methods: {
entityCampaign,
genericCampaign,
getSource,
ratioFilter,
specificCampaign,
tagCampaign,
},
};
@ -157,14 +205,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%;
}

View File

@ -16,7 +16,14 @@
<p
v-if="config.showDisclaimer"
class="disclaimer"
>{{ config.disclaimer }}</p>
v-html="config.disclaimer"
/>
<p
v-if="config.showAnnouncement"
class="announcement"
v-html="config.announcement"
/>
<div
ref="content"
@ -194,13 +201,21 @@ export default {
</style>
<style lang="scss" scoped>
.disclaimer {
.disclaimer,
.announcement {
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>

View File

@ -96,7 +96,10 @@
/>
</Scroll>
<div class="campaign-container">
<div
v-if="config.campaigns.entity"
class="campaign-container"
>
<Campaign
:entity="entity"
:min-ratio="3"
@ -114,6 +117,7 @@
<div class="releases">
<Releases
:releases="entity.releases"
:entity="entity"
:done="done"
/>
@ -130,6 +134,8 @@
</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';
@ -157,12 +163,17 @@ async function fetchEntity(scroll = true) {
const campaign = entity.campaigns.find((campaignX) => !campaignX.banner)
|| entity.parent?.campaigns.find((campaignX) => !campaignX.banner);
const affiliateParams = new URLSearchParams({
...(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();
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
...(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) {
@ -196,7 +207,7 @@ export default {
pageTitle: null,
totalCount: null,
done: false,
limit: Number(this.$route.query.limit) || 20,
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
expanded: false,
entityUrl: null,
};
@ -286,6 +297,7 @@ export default {
}
.campaign-container {
max-height: 150px;
background: var(--background-dim);
text-align: center;
padding: .5rem;

View File

@ -9,7 +9,7 @@
<RouterLink
v-if="me && favorites"
:to="{ name: 'stash', params: { stashId: favorites.id, range: 'scenes', pageNumber: 1 } }"
:to="{ name: 'stash', params: { stashId: favorites.id, stashSlug: favorites.slug, username: me.username, range: 'scenes', pageNumber: 1 } }"
class="menu-item"
><Icon icon="heart7" />Favorites</RouterLink>

View File

@ -1,7 +1,10 @@
<template>
<div class="home">
<div class="content-inner">
<div class="campaign-container">
<div
v-if="config.campaigns.home"
class="campaign-container"
>
<Campaign
:min-ratio="6"
/>
@ -35,6 +38,8 @@
</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';
@ -76,7 +81,7 @@ export default {
releases: [],
networks: [],
pageTitle: null,
limit: 30,
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
totalCount: 0,
from: null,
done: false,

View File

@ -1,6 +1,7 @@
<template>
<div
:class="{ active }"
:title="title"
class="icon"
v-html="svg"
/>

View File

@ -62,6 +62,11 @@
/>
</div>
<Releases
v-if="release.scenes && release.scenes.length > 0"
:releases="release.scenes"
/>
<div class="row associations">
<ul
ref="actors"
@ -109,11 +114,6 @@
</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"
@ -167,7 +167,13 @@
v-if="release.studio"
class="row-tidbit"
>
<span class="row-label">Studio</span>
<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>
<RouterLink
:to="`/studio/${release.studio.slug}`"
@ -471,13 +477,14 @@ export default {
}
.row-label {
display: block;
display: flex;
align-items: center;
margin: 0 0 .5rem 0;
color: var(--shadow);
font-weight: bold;
.icon {
margin: 0 .5rem 0 0;
margin: 0 .5rem;
fill: var(--shadow);
}
}

View File

@ -12,18 +12,34 @@
:key="sfw"
class="nolist tiles"
>
<li
v-for="(release, index) in releases"
:key="`release-${release.id}`"
>
<SceneTile
:release="release"
:referer="referer"
:index="index"
:stash="stash"
@stash="isStashed => $emit('stash', isStashed)"
/>
</li>
<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}`"
>
<SceneTile
:release="item"
:referer="referer"
:index="index"
:stash="stash"
@stash="isStashed => $emit('stash', isStashed)"
/>
</li>
</template>
</ul>
<span
@ -38,51 +54,55 @@
</div>
</template>
<script>
<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';
import Ellipsis from '../loading/ellipsis.vue';
import SceneTile from './scene-tile.vue';
function range() {
return this.$route.params.range;
}
const router = useRouter();
const store = useStore();
function sfw() {
return this.$store.state.ui.sfw;
}
defineEmits(['stash']);
export default {
components: {
Ellipsis,
SceneTile,
const props = defineProps({
releases: {
type: Array,
default: () => [],
},
props: {
releases: {
type: Array,
default: () => [],
},
context: {
type: String,
default: null,
},
done: {
type: Boolean,
default: true,
},
referer: {
type: String,
default: null,
},
stash: {
type: Object,
default: null,
},
entity: {
type: Object,
default: null,
},
emits: ['stash'],
computed: {
range,
sfw,
context: {
type: String,
default: null,
},
};
done: {
type: Boolean,
default: true,
},
referer: {
type: String,
default: null,
},
stash: {
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);
</script>
<style lang="scss" scoped>
@ -126,6 +146,12 @@ export default {
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));

View File

@ -100,10 +100,7 @@
>{{ release.entity.name }}</h3>
</a>
<span
v-if="release.actors?.length > 0"
class="row"
>
<span class="row">
<ul
class="actors nolist"
:title="release.actors.map(actor => actor.name).join(', ')"
@ -357,9 +354,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;
}

View File

@ -42,7 +42,7 @@ export default {
},
data() {
return {
tags: ['anal', 'gay', 'transsexual', 'bisexual', 'pissing', 'anal prolapse'],
tags: ['gay', 'transsexual', 'bisexual', 'anal', 'anal prolapse', 'pissing'],
};
},
computed: {

View File

@ -7,6 +7,11 @@
class="dialog-body"
@submit.prevent="addStash"
>
<div
v-if="errorMsg"
class="form-error"
>{{ errorMsg }}</div>
<input
ref="name"
v-model="name"
@ -27,11 +32,17 @@
<script>
async function addStash() {
await this.$store.dispatch('createStash', {
name: this.name,
});
this.errorMsg = null;
this.$emit('close', true);
try {
await this.$store.dispatch('createStash', {
name: this.name,
});
this.$emit('close', true);
} catch (error) {
this.errorMsg = error.message;
}
}
function mounted() {
@ -39,15 +50,22 @@ 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>

View File

@ -115,6 +115,8 @@ 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,

View File

@ -8,71 +8,84 @@
<dt class="stat-label">Version</dt>
<dd class="stat-value">{{ version }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Content updated</dt>
<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 }}</dd>
</div>
<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>
</div>
</dl>
<div class="stat-row">
<dt class="stat-label">Channels</dt>
<dd class="stat-value">{{ totalChannels }}</dd>
</div>
<dl class="stat-table">
<div class="stat-row">
<dt class="stat-label">Networks</dt>
<dd class="stat-value">{{ totalNetworks.toLocaleString() }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Scenes</dt>
<dd class="stat-value">{{ totalScenes }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Channels</dt>
<dd class="stat-value">{{ totalChannels.toLocaleString() }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Movies</dt>
<dd class="stat-value">{{ totalMovies }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Scenes</dt>
<dd class="stat-value">{{ totalScenes.toLocaleString() }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Actors</dt>
<dd class="stat-value">{{ totalActors }}</dd>
</div>
</dl>
<div class="stat-row">
<dt class="stat-label">Movies</dt>
<dd class="stat-value">{{ totalMovies.toLocaleString() }}</dd>
</div>
<div class="stat-row">
<dt class="stat-label">Actors</dt>
<dd class="stat-value">{{ totalActors.toLocaleString() }}</dd>
</div>
</dl>
</template>
<Ellipsis v-else />
</div>
<Footer />
</div>
</template>
<script>
async function mounted() {
const stats = await this.$store.dispatch('fetchStats');
<script setup>
import { ref, onMounted } from 'vue';
import { useStore } from 'vuex';
import { format, formatDistance } from 'date-fns';
this.totalScenes = stats.totalScenes;
this.totalMovies = stats.totalMovies;
this.totalActors = stats.totalActors;
this.totalNetworks = stats.totalNetworks;
this.totalChannels = stats.totalChannels;
this.lastScrape = stats.lastScrape;
import Ellipsis from '../loading/ellipsis.vue';
this.version = VERSION; // eslint-disable-line no-undef
}
const store = useStore();
const version = VERSION; // eslint-disable-line no-undef
export default {
data() {
return {
totalScenes: 0,
totalMovies: 0,
totalActors: 0,
totalNetworks: 0,
totalChannels: 0,
};
},
mounted,
};
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;
});
</script>
<style lang="scss" scoped>

View File

@ -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) {

View File

@ -81,6 +81,7 @@
</template>
<script>
import config from 'config';
import { Converter } from 'showdown';
import escapeHtml from '../../../src/utils/escape-html';
@ -155,7 +156,7 @@ export default {
releases: null,
done: false,
totalCount: 0,
limit: 20,
limit: Number(this.$route.query.limit || 30) - config.campaigns.tiles, // reserve one campaign spot
pageTitle: null,
hasMedia: false,
expanded: false,

View File

@ -1,13 +1,13 @@
<template>
<div class="stash">
<div class="stash-section stash-header">
<router-link
<RouterLink
: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>
</router-link>
</RouterLink>
<span class="header-actions noselect">
<label

View File

@ -14,11 +14,13 @@
<div class="section-header">
<h3 class="section-heading">Stashes</h3>
<Icon
icon="plus3"
class="header-add"
<button
v-if="isMe"
class="button button-secondary header-add"
@click="showAddStash = true"
/>
>
<Icon icon="plus3" />Add stash
</button>
</div>
<ul class="section-body stashes nolist">
@ -35,6 +37,7 @@
/>
</li>
<!--
<li
v-if="isMe"
class="stashes-stash stashes-add"
@ -42,6 +45,7 @@
>
<Icon icon="plus2" />
</li>
-->
</ul>
<AddStash
@ -54,11 +58,13 @@
<div class="section-header">
<h3 class="section-heading">Alerts</h3>
<Icon
icon="plus3"
class="header-add"
<button
v-if="isMe"
class="button button-secondary header-add"
@click="showAddAlert = true"
/>
>
<Icon icon="plus3" />Set alert
</button>
</div>
<ul class="section-body alerts nolist">
@ -74,12 +80,14 @@
/>
</li>
<!--
<li
class="alerts-add"
@click="showAddAlert = true"
>
<Icon icon="plus2" />
</li>
-->
</ul>
<AddAlert
@ -186,7 +194,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 1rem 0;
margin: 0 1rem 1rem 0;
}
.section-body {
@ -201,14 +209,6 @@ export default {
}
.header-add {
height: auto;
padding: .5rem 1rem;
fill: var(--shadow);
&:hover {
fill: var(--primary);
cursor: pointer;
}
}
.stashes-stash {

View File

@ -3,3 +3,11 @@
font-size: 1rem;
font-weight: bold;
}
.form-error {
padding: .5rem;
margin-bottom: .5rem;
color: var(--text-light);
background: var(--error);
font-weight: bold;
}

View File

@ -26,6 +26,9 @@
}
.button {
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
background: none;
padding: .5rem;
@ -49,6 +52,11 @@
background: var(--shadow-weak);
cursor: default;
}
.icon {
fill: var(--text-light);
margin-right: .5rem;
}
}
.button-secondary {
@ -57,12 +65,21 @@
&: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 {

View File

@ -52,9 +52,10 @@ $breakpoint4: 1500px;
--female: #f0a;
--alert: #f00;
--error: #f00;
--error: #fd5555;
--warn: #fa0;
--success: #5c2;
--notice: #25c;
--enabled: #5c2;
--enabled-background: rgba(0, 255, 0, .1);

View File

@ -10,6 +10,7 @@ import {
actorStashesFields,
getIncludedEntities,
getIncludedActors,
batchFragment,
} from '../fragments';
function initActorActions(store, router) {
@ -27,7 +28,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 } = await graphql(`
const { actor, batches: [lastBatch] } = await graphql(`
query Actor(
$actorId: Int!
$userId: Int,
@ -36,8 +37,6 @@ 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!],
@ -52,6 +51,7 @@ function initActorActions(store, router) {
slug
realName
gender
orientation
dateOfBirth
dateOfDeath
age
@ -204,23 +204,10 @@ function initActorActions(store, router) {
}
scenesConnection(
filter: {
or: [
{
date: {
lessThan: $before,
greaterThan: $after
}
},
{
date: {
isNull: true
},
createdAt: {
lessThan: $beforeTime,
greaterThan: $afterTime,
}
}
]
effectiveDate: {
lessThan: $before,
greaterThan: $after
}
and: [
{
or: $includedEntities
@ -254,6 +241,7 @@ function initActorActions(store, router) {
}
${actorStashesFields}
}
${batchFragment}
}
`, {
actorId,
@ -261,8 +249,6 @@ 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,
@ -281,7 +267,7 @@ function initActorActions(store, router) {
return {
actor: curateActor(actor, null, curateRelease),
releases: actor.scenesConnection.releases.map((release) => curateRelease(release)),
releases: actor.scenesConnection.releases.map((release) => curateRelease(release, 'scene', { lastBatch: lastBatch.id })),
totalCount: actor.scenesConnection.totalCount,
};
}

View File

@ -7,6 +7,11 @@ 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: [

View File

@ -65,19 +65,20 @@ function curateActor(actor, release) {
return curatedActor;
}
function curateRelease(release, type = 'scene') {
function curateRelease(release, type = 'scene', context = {}) {
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')) || [];
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.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.photos = release.photos?.filter(Boolean).map((photo) => photo.media || photo) || [];
curatedRelease.scenesPhotos = release.scenesPhotos?.filter(Boolean).map((photo) => photo.media || photo) || [];
curatedRelease.covers = release.covers?.filter(Boolean).map(({ media }) => media) || [];
@ -102,7 +103,7 @@ function curateRelease(release, type = 'scene') {
return curatedRelease;
}
function curateEntity(entity, parent, releases) {
function curateEntity(entity, parent, releases, context) {
const curatedEntity = {
...entity,
children: [],
@ -120,19 +121,19 @@ function curateEntity(entity, parent, releases) {
}
if (entity.parent || parent) curatedEntity.parent = curateEntity(entity.parent || parent);
if (releases) curatedEntity.releases = releases.map((release) => curateRelease(release));
if (releases) curatedEntity.releases = releases.map((release) => curateRelease(release, 'scene', context));
curatedEntity.sceneTotal = entity.sceneTotal;
return curatedEntity;
}
function curateTag(tag) {
function curateTag(tag, context) {
const curatedTag = {
...tag,
};
if (tag.releases) curatedTag.releases = tag.releases.map(({ release }) => curateRelease(release));
if (tag.releases) curatedTag.releases = tag.releases.map(({ release }) => curateRelease(release, 'scene', context));
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;
@ -140,14 +141,14 @@ function curateTag(tag) {
return curatedTag;
}
function curateStash(stash) {
function curateStash(stash, context) {
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: curateRelease(item.scene, 'scene', context),
}));
}
@ -163,7 +164,7 @@ function curateStash(stash) {
curatedStash.movieTotal = stash.moviesConnection?.totalCount || null;
curatedStash.movies = (stash.moviesConnection?.movies || stash.movies).map((item) => ({
...item,
movie: curateRelease(item.movie),
movie: curateRelease(item.movie, 'movie', context),
}));
}

View File

@ -1,6 +1,6 @@
import { graphql } from '../api';
// import { sitesFragment, releaseFields } from '../fragments';
import { releaseFields, campaignsFragment } from '../fragments';
import { releaseFields, batchFragment, 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 } = await graphql(`
const { entity, connection, batches: [lastBatch] } = await graphql(`
query Entity(
$entitySlug: String!
$entityType: String! = "channel"
@ -84,32 +84,55 @@ function initEntitiesActions(store, router) {
hasLogo
${campaignsFragment}
}
connection: scenesConnection(
first: $limit
offset: $offset
orderBy: $orderBy
filter: {
effectiveDate: {
lessThan: $before,
greaterThan: $after
}
releasesTagsConnection: {
none: {
tag: {
slug: {
in: $exclude
}
}
connection: releasesConnection(
first: $limit
offset: $offset
orderBy: $orderBy
filter: {
entity: {
or: [
{
slug: { equalTo: $entitySlug }
type: { equalTo: $entityType }
}
{
parent:{
slug: { equalTo: $entitySlug }
type: { equalTo: $entityType }
}
}
{
parent:{
parent: {
slug: { equalTo: $entitySlug }
type: { equalTo: $entityType }
}
}
}
]
}
effectiveDate: {
lessThan: $before,
greaterThan: $after
}
releasesTagsConnection: {
none: {
tag: {
slug: {
in: $exclude
}
}
}
}
) {
releases: nodes {
${releaseFields}
}
totalCount
}
}
) {
releases: nodes {
${releaseFields}
}
totalCount
}
${batchFragment}
}
`, {
entitySlug,
@ -130,8 +153,8 @@ function initEntitiesActions(store, router) {
}
return {
entity: curateEntity(entity, null, entity.connection.releases),
totalCount: entity.connection.totalCount,
entity: curateEntity(entity, null, connection.releases, { lastBatch: lastBatch?.id }),
totalCount: connection.totalCount,
};
}

View File

@ -70,6 +70,7 @@ const actorFields = `
ageFromBirth
dateOfBirth
gender
orientation
avatar: avatarMedia {
id
path
@ -165,6 +166,47 @@ const movieFields = `
}
`;
const campaignFields = `
id
url
affiliate {
id
url
parameters
}
banner {
id
type
width
height
ratio
entity {
id
type
name
slug
parent {
id
type
name
slug
}
}
}
entity {
id
type
name
slug
parent {
id
type
name
slug
}
}
`;
const campaignsFragment = `
campaigns(filter: {
or: [
@ -186,44 +228,7 @@ const campaignsFragment = `
}
]
}) {
id
url
affiliate {
id
url
parameters
}
banner {
id
type
width
height
ratio
entity {
id
type
name
slug
parent {
id
type
name
slug
}
}
}
entity {
id
type
name
slug
parent {
id
type
name
slug
}
}
${campaignFields}
}
`;
@ -393,7 +398,6 @@ const releaseFields = `
slug
}
}
isNew
isFavorited
isStashed(includeFavorites: false)
stashes: stashesScenesBySceneId(
@ -413,22 +417,22 @@ const releaseFields = `
}
}
`;
// isNew too performance-intensive
const releasesFragment = `
connection: releasesConnection(
filter: {
releasesNotShowcasedsConnectionExist: false
date: {
effectiveDate: {
lessThan: $before,
greaterThan: $after
}
releasesTagsConnection: {
none: {
tag: {
or: [
{ slug: { in: $exclude } }
{ name: { in: $exclude } }
]
slug: {
in: $exclude
}
}
}
}
@ -536,6 +540,7 @@ const releaseFragment = `
name
slug
url
showcased
}
movies: moviesScenesBySceneId {
movie {
@ -596,6 +601,12 @@ const releaseFragment = `
}
`;
const batchFragment = `
batches(first: 1, orderBy: CREATED_AT_DESC) {
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(',') : [];
@ -662,6 +673,8 @@ function getIncludedActors(router) {
export {
actorFields,
actorStashesFields,
batchFragment,
campaignFields,
campaignsFragment,
mediaFields,
mediaFragment,

View File

@ -12,7 +12,7 @@ const dateRanges = {
upcoming: () => ({
after: dayjs.utc().toDate(),
before: '2100-01-01',
orderBy: ['EFFECTIVE_DATE_DESC'],
orderBy: ['EFFECTIVE_DATE_ASC'],
}),
new: () => ({
after: '1900-01-01 00:00:00',

View File

@ -8,6 +8,7 @@ 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';
@ -101,12 +102,7 @@ async function init() {
},
watch: {
pageTitle(title) {
if (title) {
document.title = `traxxx - ${title}`;
return;
}
document.title = 'traxxx';
setPageTitle(title); // for Options API components
},
},
beforeCreate() {

View File

@ -1,7 +1,7 @@
import { graphql } from '../api';
// import { sitesFragment, releaseFields } from '../fragments';
import { releaseFields } from '../fragments';
import { curateNetwork } from '../curate';
import { curateEntity } from '../curate';
import getDateRange from '../get-date-range';
function initNetworksActions(store, _router) {
@ -59,23 +59,10 @@ function initNetworksActions(store, _router) {
{ parent: { parent: { slug: { equalTo: $networkSlug } } } }
]
}
or: [
{
date: {
lessThan: $before,
greaterThan: $after
}
},
{
date: {
isNull: true
},
createdAt: {
lessThan: $beforeTime,
greaterThan: $afterTime,
}
}
]
effectiveDate: {
lessThan: $before,
greaterThan: $after
}
releasesTagsConnection: {
none: {
tag: {
@ -106,7 +93,7 @@ function initNetworksActions(store, _router) {
});
return {
network: curateNetwork(network, releases),
network: curateEntity(network, releases),
totalCount,
};
}
@ -131,7 +118,7 @@ function initNetworksActions(store, _router) {
}
`);
return networks.map(network => curateNetwork(network));
return networks.map((network) => curateEntity(network));
}
return {

View File

@ -1,5 +1,6 @@
import { graphql } from '../api';
import {
batchFragment,
releasesFragment,
releaseFragment,
releaseFields,
@ -14,7 +15,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 } } = await graphql(`
const { connection: { releases, totalCount }, batches: [lastBatch] } = await graphql(`
query Releases(
$hasAuth: Boolean!
$userId: Int
@ -26,6 +27,7 @@ function initReleasesActions(store, router) {
$exclude: [String!]
) {
${releasesFragment}
${batchFragment}
}
`, {
hasAuth: !!store.state.auth.user,
@ -39,7 +41,7 @@ function initReleasesActions(store, router) {
});
return {
releases: releases.map((release) => curateRelease(release.release || release)),
releases: releases.map((release) => curateRelease(release.release || release, 'scene', { lastBatch: lastBatch.id })),
totalCount,
};
}
@ -80,12 +82,7 @@ function initReleasesActions(store, router) {
connection: moviesConnection(
first: $limit
offset: $offset
orderBy: DATE_DESC
filter: {
date: {
isNull: false
}
}
orderBy: EFFECTIVE_DATE_DESC
) {
movies: nodes {
${movieFields}

View File

@ -1,5 +1,7 @@
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';
@ -233,7 +235,7 @@ const routes = [
name: 'notifications',
},
{
path: '/stash/:stashId/:stashSlug',
path: '/stash/:username/:stashSlug',
redirect: (from) => ({
name: 'stash',
params: {
@ -244,7 +246,7 @@ const routes = [
}),
},
{
path: '/stash/:stashId/:stashSlug?/:range/:pageNumber',
path: '/stash/:username/:stashSlug/:range/:pageNumber',
component: Stash,
name: 'stash',
},
@ -257,11 +259,17 @@ 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(.*)',
@ -276,4 +284,6 @@ const router = createRouter({
routes,
});
router.beforeEach((to) => setPageTitle(to.meta.title));
export default router;

View File

@ -0,0 +1,10 @@
function setPageTitle(name) {
if (name) {
document.title = `traxxx - ${name}`;
return;
}
document.title = 'traxxx';
}
export default setPageTitle;

View File

@ -1,6 +1,6 @@
import { graphql } from '../api';
import { releaseFields } from '../fragments';
import { curateSite, curateRelease } from '../curate';
import { curateEntity, curateRelease } from '../curate';
import getDateRange from '../get-date-range';
function initSitesActions(store, _router) {
@ -41,7 +41,7 @@ function initSitesActions(store, _router) {
}
releasesConnection(
filter: {
date: {
effectiveDate: {
lessThan: $before,
greaterThan: $after,
},
@ -75,7 +75,7 @@ function initSitesActions(store, _router) {
equalTo: $siteSlug
}
}
date: {
effectiveDate: {
lessThan: $before,
greaterThan: $after
}
@ -103,13 +103,12 @@ function initSitesActions(store, _router) {
after,
before,
orderBy,
isNew: store.getters.isNew,
exclude: store.state.ui.filter,
});
return {
site: curateSite(site),
releases: releases.map(release => curateRelease(release)),
site: curateEntity(site),
releases: releases.map((release) => curateRelease(release)),
totalCount,
};
}

View File

@ -10,14 +10,16 @@ import { curateStash } from '../curate';
function initStashesActions(store, _router) {
async function fetchStash(context, {
stashId,
stashSlug,
username,
section = 'scenes',
pageNumber = 1,
limit = 20,
}) {
const { stash } = await graphql(`
const { stashes: [stash] } = await graphql(`
query Stash(
$stashId: Int!
$stashSlug: String!
$username: String!
$includeScenes: Boolean!
$includeActors: Boolean!
$includeMovies: Boolean!
@ -26,7 +28,12 @@ function initStashesActions(store, _router) {
$hasAuth: Boolean!
$userId: Int
) {
stash(id: $stashId) {
stashes(
filter: {
user: { username: { equalTo: $username } }
slug: { equalTo: $stashSlug }
}
) {
id
name
slug
@ -101,7 +108,8 @@ function initStashesActions(store, _router) {
}
}
`, {
stashId: Number(stashId),
stashSlug,
username,
includeScenes: section === 'scenes',
includeActors: section === 'actors',
includeMovies: section === 'movies',

View File

@ -1,6 +1,7 @@
import { graphql, get } from '../api';
import {
releaseFields,
batchFragment,
} from '../fragments';
import { curateTag, curateRelease } from '../curate';
import getDateRange from '../get-date-range';
@ -14,7 +15,7 @@ function initTagsActions(store, _router) {
}) {
const { before, after, orderBy } = getDateRange(range);
const { tagBySlug } = await graphql(`
const { tagBySlug, batches: [lastBatch] } = await graphql(`
query Tag(
$tagSlug:String!
$offset: Int = 0,
@ -156,7 +157,7 @@ function initTagsActions(store, _router) {
}
scenesConnection(
filter: {
date: {
effectiveDate: {
lessThan: $before,
greaterThan: $after,
},
@ -180,6 +181,7 @@ function initTagsActions(store, _router) {
totalCount
}
}
${batchFragment}
}
`, {
tagSlug,
@ -195,7 +197,7 @@ function initTagsActions(store, _router) {
return {
tag: curateTag(tagBySlug, null, curateRelease),
releases: tagBySlug.scenesConnection.releases.map((release) => curateRelease(release)),
releases: tagBySlug.scenesConnection.releases.map((release) => curateRelease(release, 'scene', { lastBatch: lastBatch.id })),
totalCount: tagBySlug.scenesConnection.totalCount,
};
}

View File

@ -1,5 +1,12 @@
import { graphql, patch } from '../api';
import { releaseFields, actorStashesFields } from '../fragments';
import {
releaseFields,
batchFragment,
campaignFields,
actorStashesFields,
} from '../fragments';
import { curateRelease, curateActor, curateNotification } from '../curate';
function initUiActions(store, _router) {
@ -218,6 +225,7 @@ function initUiActions(store, _router) {
}
${actorStashesFields}
}
${batchFragment}
}
`, {
query,
@ -227,7 +235,7 @@ function initUiActions(store, _router) {
});
return {
releases: res?.results.map((result) => curateRelease(result.release)) || [],
releases: res?.results.map((result) => curateRelease(result.release, 'scene', { lastBatch: res?.batches[0].id })) || [],
actors: res?.actors.map((actor) => curateActor(actor)) || [],
};
}
@ -239,29 +247,7 @@ function initUiActions(store, _router) {
$maxRatio: BigFloat
) {
randomCampaign: getRandomCampaign(minRatio: $minRatio, maxRatio: $maxRatio) {
url
affiliate {
url
}
banner {
id
type
ratio
entity {
type
slug
parent {
type
slug
}
}
}
entity {
slug
}
parent {
slug
}
${campaignFields}
}
}
`, {
@ -272,6 +258,23 @@ function initUiActions(store, _router) {
return randomCampaign;
}
async function fetchCampaign(context, campaignId) {
console.log(campaignId);
const { campaign } = await graphql(`
query Campaign(
$campaignId: Int!
) {
campaign(id: $campaignId) {
${campaignFields}
}
}
`, {
campaignId: Number(campaignId),
});
return campaign;
}
async function fetchStats() {
const {
scenes,
@ -279,23 +282,15 @@ function initUiActions(store, _router) {
actors,
networks,
channels,
batches: [batch],
} = await graphql(`
query Stats {
scenes: releasesConnection(
last: 1,
orderBy: BATCH_BY_CREATED_BATCH_ID__CREATED_AT_ASC
) {
totalCount
scenes: nodes {
batch: createdBatch {
createdAt
}
}
}
scenes: releasesConnection { totalCount }
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 }
}
`);
@ -305,7 +300,7 @@ function initUiActions(store, _router) {
totalActors: actors.totalCount,
totalNetworks: networks.totalCount,
totalChannels: channels.totalCount,
lastScrape: new Date(scenes.scenes[0]?.batch.createdAt),
lastScrape: new Date(batch.createdAt),
};
}
@ -319,6 +314,7 @@ function initUiActions(store, _router) {
setBatch,
setSfw,
setTheme,
fetchCampaign,
fetchRandomCampaign,
fetchNotifications,
fetchStats,

View File

@ -12,6 +12,8 @@ module.exports = {
password: 'password',
database: 'traxxx',
},
timeout: 5000,
graphiql: false,
},
web: {
host: '0.0.0.0',
@ -37,6 +39,8 @@ module.exports = {
auth: {
login: true,
signup: true,
usernameLength: [2, 24],
usernamePattern: /^[a-zA-Z0-9_-]+$/,
},
exclude: {
channels: [
@ -63,6 +67,10 @@ module.exports = {
'lowartfilms',
// freeones
'freeones',
// new sesations
'tabutales',
'talesfromtheedge',
'shanedieselsbangingbabes',
// pornpros
'milfhumiliation',
'humiliated',
@ -254,18 +262,21 @@ 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',
@ -273,6 +284,7 @@ module.exports = {
'cdn.blackedraw.com',
'cdn.tushyraw.com',
'cdn.slayed.com',
'cdn.milfy.com',
'www.vogov.com',
'www.vogov.com',
'www.nubiles.net',
@ -297,6 +309,7 @@ module.exports = {
enable: false,
hostnames: [ // these can run in the same browser session
'www.kink.com',
'store2.psmcdn.net', // Team Skeet API
],
},
cloudflare: {
@ -337,6 +350,10 @@ 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
@ -345,6 +362,8 @@ module.exports = {
lazyQuality: 90,
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,

18
ecosystem.config.js Normal file
View File

@ -0,0 +1,18 @@
// 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',
},
},
],
};

View File

@ -64,6 +64,7 @@ exports.up = (knex) => Promise.resolve()
table.boolean('independent')
.defaultTo(false);
table.boolean('showcased');
table.boolean('visible')
.defaultTo(true);
@ -272,6 +273,7 @@ exports.up = (knex) => Promise.resolve()
table.integer('age', 3);
table.text('gender', 18);
table.text('orientation');
table.text('description');
table.text('birth_city');
@ -345,6 +347,7 @@ 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');
@ -651,6 +654,8 @@ exports.up = (knex) => Promise.resolve()
table.integer('duration')
.unsigned();
table.specificType('qualities', 'text[]');
table.boolean('deep');
table.text('deep_url', 1000);
@ -804,6 +809,8 @@ 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)
@ -873,6 +880,8 @@ 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)
@ -916,12 +925,151 @@ 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);
@ -1062,6 +1210,8 @@ 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');
@ -1088,7 +1238,12 @@ 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()
@ -1152,6 +1307,27 @@ 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');
@ -1329,6 +1505,9 @@ 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');
@ -1372,17 +1551,46 @@ 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
@ -1401,6 +1609,8 @@ 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
@ -1421,15 +1631,13 @@ 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 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
SELECT results.release_id, ts_rank(results.document::tsvector, curate_search_query(query)) as rank
FROM (
SELECT releases_search.release_id, document
FROM releases_search
) ranks
LEFT JOIN releases ON releases.id = ranks.release_id
WHERE ranks.rank > 0
ORDER BY ranks.rank DESC;
WHERE document::tsvector @@ curate_search_query(query)
) AS results
ORDER BY rank DESC;
$$ LANGUAGE SQL STABLE;
CREATE FUNCTION search_movies(query text) RETURNS SETOF movies_search_results AS $$
@ -1513,6 +1721,52 @@ 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 $$
@ -1589,7 +1843,7 @@ exports.up = (knex) => Promise.resolve()
ORDER BY tags.priority DESC
$$ LANGUAGE SQL STABLE;
CREATE FUNCTION movies_photos(movie movies) RETURNS SETOF media AS $$
CREATE FUNCTION movies_scenes_photos(movie movies) RETURNS SETOF media AS $$
SELECT media.*
FROM movies_scenes
LEFT JOIN
@ -1607,15 +1861,111 @@ 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 banners_ratio(banner banners) RETURNS numeric AS $$
SELECT ROUND(banner.width::decimal / banner.height::decimal, 2);
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 get_random_campaign() RETURNS SETOF campaigns AS $$
SELECT * FROM campaigns
ORDER BY random()
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()
LIMIT 1;
$$ LANGUAGE sql STABLE;
$$ 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';
`);
})
// POLICIES
@ -1632,6 +1982,7 @@ 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());
@ -1662,6 +2013,14 @@ 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;
@ -1729,33 +2088,6 @@ 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
@ -1776,8 +2108,17 @@ 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;
@ -1789,6 +2130,7 @@ 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;
@ -1812,6 +2154,7 @@ 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;
@ -1853,6 +2196,9 @@ 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;
@ -1860,7 +2206,11 @@ 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_photos;
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 POLICY IF EXISTS stashes_policy ON stashes;
DROP POLICY IF EXISTS stashes_policy ON stashes_scenes;

View File

@ -1,29 +0,0 @@
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;
`);

View File

@ -1,15 +0,0 @@
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');
}));

View File

@ -1,11 +0,0 @@
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;
`);

View File

@ -1,23 +0,0 @@
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;
`);

View File

@ -1,215 +0,0 @@
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;
`));

View File

@ -1,49 +0,0 @@
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;
`);

View File

@ -1,7 +0,0 @@
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');
});

View File

@ -1,7 +0,0 @@
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');
});

View File

@ -1,58 +0,0 @@
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;
`);

View File

@ -1,8 +0,0 @@
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');
});

View File

@ -1,20 +0,0 @@
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;
`);

View File

@ -0,0 +1,58 @@
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;
`);
};

View File

@ -1,25 +0,0 @@
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;
`);

View File

@ -0,0 +1,11 @@
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');
});
};

1337
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.225.10",
"version": "1.228.33",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {
@ -91,6 +91,7 @@
"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",
@ -113,6 +114,7 @@
"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",
@ -120,15 +122,14 @@
"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": "^18.2.0",
"puppeteer-extra": "^3.3.4",
"puppeteer-extra-plugin-stealth": "^2.11.1",
"puppeteer": "^20.5.0",
"puppeteer-extra": "^3.3.6",
"puppeteer-extra-plugin-stealth": "^2.11.2",
"sharp": "^0.29.2",
"showdown": "^1.9.1",
"source-map-support": "^0.5.16",
@ -138,7 +139,7 @@
"tunnel": "0.0.6",
"ua-parser-js": "^1.0.32",
"undici": "^4.13.0",
"unprint": "^0.8.2",
"unprint": "^0.10.1",
"url-pattern": "^1.0.3",
"v-tooltip": "^2.0.3",
"video.js": "^7.11.4",

View File

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Some files were not shown because too many files have changed in this diff Show More