155 Commits

Author SHA1 Message Date
boi12321
fde9312fa9 cleanup some unused dependencies 2023-07-14 13:12:54 +02:00
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 22805 additions and 2034 deletions

3
.gitignore vendored
View File

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

View File

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

View File

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

View File

@@ -1,21 +1,23 @@
<template> <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 <a
v-if="campaign" v-else-if="campaign"
:href="campaign.url || campaign.affiliate?.url" :href="campaign.url || campaign.affiliate?.url"
target="_blank" target="_blank"
class="campaign" class="campaign"
> >
<img <img
v-if="campaign.banner.entity.type === 'network' || !campaign.banner.entity.parent" :src="getSource(campaign)"
:src="`/img/banners/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`"
:width="campaign.banner.width"
:height="campaign.banner.height"
class="campaign-banner"
>
<img
v-if="campaign.banner.entity.type === 'channel' && campaign.banner.entity.parent?.type === 'network'"
:src="`/img/banners/${campaign.banner.entity.parent.slug}/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`"
:width="campaign.banner.width" :width="campaign.banner.width"
:height="campaign.banner.height" :height="campaign.banner.height"
class="campaign-banner" class="campaign-banner"
@@ -37,6 +39,12 @@ function ratioFilter(banner) {
return false; 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) { if (this.minRatio && banner.ratio < this.minRatio) {
return false; return false;
} }
@@ -48,6 +56,18 @@ function ratioFilter(banner) {
return true; 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() { function entityCampaign() {
const bannerCampaigns = this.entity.campaigns const bannerCampaigns = this.entity.campaigns
.concat(this.entity.children?.flatMap((child) => child.campaigns)) .concat(this.entity.children?.flatMap((child) => child.campaigns))
@@ -63,6 +83,10 @@ function entityCampaign() {
return randomCampaign; return randomCampaign;
} }
if (this.allowGeneric) {
return this.genericCampaign();
}
this.$emit('campaign', null); this.$emit('campaign', null);
return null; return null;
@@ -84,6 +108,10 @@ function tagCampaign() {
return randomCampaign; return randomCampaign;
} }
if (this.allowGeneric) {
return this.genericCampaign();
}
this.$emit('campaign', null); this.$emit('campaign', null);
return null; return null;
@@ -98,7 +126,21 @@ async function genericCampaign() {
return randomCampaign; 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() { async function mounted() {
if (this.$route.query.campaign) {
await this.specificCampaign(this.$route.query.campaign);
return;
}
if (this.entity) { if (this.entity) {
await this.entityCampaign(); await this.entityCampaign();
return; return;
@@ -134,6 +176,10 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
allowGeneric: {
type: Boolean,
default: false,
},
maxRatio: { maxRatio: {
type: Number, type: Number,
default: null, default: null,
@@ -149,7 +195,9 @@ export default {
methods: { methods: {
entityCampaign, entityCampaign,
genericCampaign, genericCampaign,
getSource,
ratioFilter, ratioFilter,
specificCampaign,
tagCampaign, tagCampaign,
}, },
}; };
@@ -157,14 +205,15 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.campaign { .campaign {
height: 100%;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: none;
} }
.campaign-banner { .campaign-banner {
height: auto; height: auto;
width: auto;
max-height: 100%; max-height: 100%;
max-width: 100%; max-width: 100%;
} }

View File

@@ -16,7 +16,14 @@
<p <p
v-if="config.showDisclaimer" v-if="config.showDisclaimer"
class="disclaimer" class="disclaimer"
>{{ config.disclaimer }}</p> v-html="config.disclaimer"
/>
<p
v-if="config.showAnnouncement"
class="announcement"
v-html="config.announcement"
/>
<div <div
ref="content" ref="content"
@@ -194,13 +201,21 @@ export default {
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.disclaimer { .disclaimer,
.announcement {
padding: .5rem 1rem; padding: .5rem 1rem;
margin: 0; margin: 0;
color: var(--text-light); color: var(--text-light);
background: var(--warn);
font-weight: bold; font-weight: bold;
box-shadow: inset 0 0 3px var(--darken-weak); box-shadow: inset 0 0 3px var(--darken-weak);
text-align: center; text-align: center;
} }
.disclaimer {
background: var(--warn);
}
.announcement {
background: var(--notice);
}
</style> </style>

View File

@@ -96,7 +96,10 @@
/> />
</Scroll> </Scroll>
<div class="campaign-container"> <div
v-if="config.campaigns.entity"
class="campaign-container"
>
<Campaign <Campaign
:entity="entity" :entity="entity"
:min-ratio="3" :min-ratio="3"
@@ -114,6 +117,7 @@
<div class="releases"> <div class="releases">
<Releases <Releases
:releases="entity.releases" :releases="entity.releases"
:entity="entity"
:done="done" :done="done"
/> />
@@ -130,6 +134,8 @@
</template> </template>
<script> <script>
import config from 'config';
import FilterBar from '../filters/filter-bar.vue'; import FilterBar from '../filters/filter-bar.vue';
import Pagination from '../pagination/pagination.vue'; import Pagination from '../pagination/pagination.vue';
import Releases from '../releases/releases.vue'; import Releases from '../releases/releases.vue';
@@ -157,12 +163,17 @@ async function fetchEntity(scroll = true) {
const campaign = entity.campaigns.find((campaignX) => !campaignX.banner) const campaign = entity.campaigns.find((campaignX) => !campaignX.banner)
|| entity.parent?.campaigns.find((campaignX) => !campaignX.banner); || entity.parent?.campaigns.find((campaignX) => !campaignX.banner);
if (entity.url) {
const { searchParams, pathname, origin } = new URL(entity.url);
const affiliateParams = new URLSearchParams({ const affiliateParams = new URLSearchParams({
...(entity.url && Object.fromEntries(new URL(entity.url).searchParams)), // preserve any query in entity URL, e.g. ?siteId=5 ...(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 ...(campaign?.affiliate?.parameters && Object.fromEntries(new URLSearchParams(campaign.affiliate.parameters))), // append affiliate parameters
}).toString(); }).toString();
this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${entity.url}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`; this.entityUrl = campaign?.url || campaign?.affiliate?.url || `${origin}${pathname}${campaign?.affiliate?.parameters ? `?${affiliateParams}` : ''}`;
}
this.done = true; this.done = true;
if (scroll && this.$refs.filter?.$el) { if (scroll && this.$refs.filter?.$el) {
@@ -196,7 +207,7 @@ export default {
pageTitle: null, pageTitle: null,
totalCount: null, totalCount: null,
done: false, 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, expanded: false,
entityUrl: null, entityUrl: null,
}; };
@@ -286,6 +297,7 @@ export default {
} }
.campaign-container { .campaign-container {
max-height: 150px;
background: var(--background-dim); background: var(--background-dim);
text-align: center; text-align: center;
padding: .5rem; padding: .5rem;

View File

@@ -9,7 +9,7 @@
<RouterLink <RouterLink
v-if="me && favorites" 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" class="menu-item"
><Icon icon="heart7" />Favorites</RouterLink> ><Icon icon="heart7" />Favorites</RouterLink>

View File

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

View File

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

View File

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

View File

@@ -12,18 +12,34 @@
:key="sfw" :key="sfw"
class="nolist tiles" class="nolist tiles"
> >
<template v-for="(item, index) in items">
<li <li
v-for="(release, index) in releases" v-if="item === 'campaign'"
:key="`release-${release.id}`" :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 <SceneTile
:release="release" :release="item"
:referer="referer" :referer="referer"
:index="index" :index="index"
:stash="stash" :stash="stash"
@stash="isStashed => $emit('stash', isStashed)" @stash="isStashed => $emit('stash', isStashed)"
/> />
</li> </li>
</template>
</ul> </ul>
<span <span
@@ -38,28 +54,31 @@
</div> </div>
</template> </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 Ellipsis from '../loading/ellipsis.vue';
import SceneTile from './scene-tile.vue'; import SceneTile from './scene-tile.vue';
function range() { const router = useRouter();
return this.$route.params.range; const store = useStore();
}
function sfw() { defineEmits(['stash']);
return this.$store.state.ui.sfw;
}
export default { const props = defineProps({
components: {
Ellipsis,
SceneTile,
},
props: {
releases: { releases: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
entity: {
type: Object,
default: null,
},
context: { context: {
type: String, type: String,
default: null, default: null,
@@ -76,13 +95,14 @@ export default {
type: Object, type: Object,
default: null, default: null,
}, },
}, });
emits: ['stash'],
computed: { const campaignIndex = computed(() => Math.floor(Math.random() * props.releases.length - 5) + 5);
range,
sfw, 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -126,6 +146,12 @@ export default {
font-weight: bold; font-weight: bold;
} }
.campaign {
display: flex;
align-items: flex-start;
justify-content: center;
}
@media(max-width: $breakpoint-mega) { @media(max-width: $breakpoint-mega) {
.tiles { .tiles {
grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));

View File

@@ -100,10 +100,7 @@
>{{ release.entity.name }}</h3> >{{ release.entity.name }}</h3>
</a> </a>
<span <span class="row">
v-if="release.actors?.length > 0"
class="row"
>
<ul <ul
class="actors nolist" class="actors nolist"
:title="release.actors.map(actor => actor.name).join(', ')" :title="release.actors.map(actor => actor.name).join(', ')"
@@ -357,9 +354,9 @@ export default {
} }
.actors { .actors {
height: 1.5rem;
word-wrap: break-word; word-wrap: break-word;
overflow: hidden; overflow: hidden;
max-height: 1.5rem;
line-height: 1.5rem; line-height: 1.5rem;
margin: 0 0 .25rem 0; margin: 0 0 .25rem 0;
} }

View File

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

View File

@@ -7,6 +7,11 @@
class="dialog-body" class="dialog-body"
@submit.prevent="addStash" @submit.prevent="addStash"
> >
<div
v-if="errorMsg"
class="form-error"
>{{ errorMsg }}</div>
<input <input
ref="name" ref="name"
v-model="name" v-model="name"
@@ -27,11 +32,17 @@
<script> <script>
async function addStash() { async function addStash() {
this.errorMsg = null;
try {
await this.$store.dispatch('createStash', { await this.$store.dispatch('createStash', {
name: this.name, name: this.name,
}); });
this.$emit('close', true); this.$emit('close', true);
} catch (error) {
this.errorMsg = error.message;
}
} }
function mounted() { function mounted() {
@@ -39,15 +50,22 @@ function mounted() {
} }
export default { export default {
emits: ['close'],
data() { data() {
return { return {
errorMsg: null,
name: null, name: null,
}; };
}, },
emits: ['close'],
mounted, mounted,
methods: { methods: {
addStash, addStash,
}, },
}; };
</script> </script>
<style lang="scss" scoped>
.input {
width: 100%;
}
</style>

View File

@@ -115,6 +115,8 @@ import Pagination from '../pagination/pagination.vue';
async function fetchStash() { async function fetchStash() {
this.stash = await this.$store.dispatch('fetchStash', { this.stash = await this.$store.dispatch('fetchStash', {
stashId: this.$route.params.stashId, stashId: this.$route.params.stashId,
stashSlug: this.$route.params.stashSlug,
username: this.$route.params.username,
section: this.$route.params.range, section: this.$route.params.range,
pageNumber: this.$route.params.pageNumber || 1, pageNumber: this.$route.params.pageNumber || 1,
limit: this.limit, limit: this.limit,

View File

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

View File

@@ -49,11 +49,11 @@ import Campaign from '../campaigns/campaign.vue';
function photos() { function photos() {
if (this.tag.poster && this.$store.state.ui.sfw) { 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) { 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) { if (this.tag.poster) {

View File

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

View File

@@ -1,13 +1,13 @@
<template> <template>
<div class="stash"> <div class="stash">
<div class="stash-section stash-header"> <div class="stash-section stash-header">
<router-link <RouterLink
:to="{ name: 'stash', params: { stashId: stash.id, stashSlug: stash.slug, range: 'scenes', pageNumber: 1 } }" :to="{ name: 'stash', params: { stashId: stash.id, stashSlug: stash.slug, range: 'scenes', pageNumber: 1 } }"
class="stash-link nolink" class="stash-link nolink"
> >
<h4 class="stash-name">{{ stash.name }}</h4> <h4 class="stash-name">{{ stash.name }}</h4>
<span class="stash-more">Browse</span> <span class="stash-more">Browse</span>
</router-link> </RouterLink>
<span class="header-actions noselect"> <span class="header-actions noselect">
<label <label

View File

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

View File

@@ -3,3 +3,11 @@
font-size: 1rem; font-size: 1rem;
font-weight: bold; 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 { .button {
display: inline-flex;
align-items: center;
justify-content: center;
border: none; border: none;
background: none; background: none;
padding: .5rem; padding: .5rem;
@@ -49,6 +52,11 @@
background: var(--shadow-weak); background: var(--shadow-weak);
cursor: default; cursor: default;
} }
.icon {
fill: var(--text-light);
margin-right: .5rem;
}
} }
.button-secondary { .button-secondary {
@@ -57,12 +65,21 @@
&:hover:not(:disabled) { &:hover:not(:disabled) {
color: var(--text-light); color: var(--text-light);
background: var(--primary); background: var(--primary);
.icon {
fill: var(--text-light);
}
} }
&:disabled { &:disabled {
color: var(--shadow-strong); color: var(--shadow-strong);
cursor: default; cursor: default;
} }
.icon {
fill: var(--primary);
margin-right: .5rem;
}
} }
.album-toggle { .album-toggle {

View File

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

View File

@@ -10,6 +10,7 @@ import {
actorStashesFields, actorStashesFields,
getIncludedEntities, getIncludedEntities,
getIncludedActors, getIncludedActors,
batchFragment,
} from '../fragments'; } from '../fragments';
function initActorActions(store, router) { 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 includedTags = router.currentRoute.value.query.tags ? router.currentRoute.value.query.tags.split(',') : [];
const mode = router.currentRoute.value.query.mode || 'all'; const mode = router.currentRoute.value.query.mode || 'all';
const { actor } = await graphql(` const { actor, batches: [lastBatch] } = await graphql(`
query Actor( query Actor(
$actorId: Int! $actorId: Int!
$userId: Int, $userId: Int,
@@ -36,8 +37,6 @@ function initActorActions(store, router) {
$offset:Int = 0, $offset:Int = 0,
$after:Datetime = "1900-01-01", $after:Datetime = "1900-01-01",
$before:Datetime = "2100-01-01", $before:Datetime = "2100-01-01",
$afterTime:Datetime = "1900-01-01",
$beforeTime:Datetime = "2100-01-01",
$orderBy:[ReleasesOrderBy!] $orderBy:[ReleasesOrderBy!]
$selectableTags: [String], $selectableTags: [String],
$includedTags: [String!], $includedTags: [String!],
@@ -52,6 +51,7 @@ function initActorActions(store, router) {
slug slug
realName realName
gender gender
orientation
dateOfBirth dateOfBirth
dateOfDeath dateOfDeath
age age
@@ -204,23 +204,10 @@ function initActorActions(store, router) {
} }
scenesConnection( scenesConnection(
filter: { filter: {
or: [ effectiveDate: {
{
date: {
lessThan: $before, lessThan: $before,
greaterThan: $after greaterThan: $after
} }
},
{
date: {
isNull: true
},
createdAt: {
lessThan: $beforeTime,
greaterThan: $afterTime,
}
}
]
and: [ and: [
{ {
or: $includedEntities or: $includedEntities
@@ -254,6 +241,7 @@ function initActorActions(store, router) {
} }
${actorStashesFields} ${actorStashesFields}
} }
${batchFragment}
} }
`, { `, {
actorId, actorId,
@@ -261,8 +249,6 @@ function initActorActions(store, router) {
offset: Math.max(0, (pageNumber - 1)) * limit, offset: Math.max(0, (pageNumber - 1)) * limit,
after, after,
before, before,
afterTime: store.getters.after,
beforeTime: store.getters.before,
selectableTags: config.selectableTags, selectableTags: config.selectableTags,
orderBy, orderBy,
exclude: store.state.ui.tagFilter, exclude: store.state.ui.tagFilter,
@@ -281,7 +267,7 @@ function initActorActions(store, router) {
return { return {
actor: curateActor(actor, null, curateRelease), 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, totalCount: actor.scenesConnection.totalCount,
}; };
} }

View File

@@ -7,6 +7,11 @@ export default {
mediaPath: '/media', mediaPath: '/media',
s3Path: 'https://s3.wasabisys.com', s3Path: 'https://s3.wasabisys.com',
}, },
campaigns: {
home: true,
entity: true,
tiles: 0,
},
showDisclaimer: false, 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!', 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: [ selectableTags: [

View File

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

View File

@@ -1,6 +1,6 @@
import { graphql } from '../api'; import { graphql } from '../api';
// import { sitesFragment, releaseFields } from '../fragments'; // import { sitesFragment, releaseFields } from '../fragments';
import { releaseFields, campaignsFragment } from '../fragments'; import { releaseFields, batchFragment, campaignsFragment } from '../fragments';
import { curateEntity } from '../curate'; import { curateEntity } from '../curate';
import getDateRange from '../get-date-range'; import getDateRange from '../get-date-range';
@@ -14,7 +14,7 @@ function initEntitiesActions(store, router) {
}) { }) {
const { before, after, orderBy } = getDateRange(range); const { before, after, orderBy } = getDateRange(range);
const { entity } = await graphql(` const { entity, connection, batches: [lastBatch] } = await graphql(`
query Entity( query Entity(
$entitySlug: String! $entitySlug: String!
$entityType: String! = "channel" $entityType: String! = "channel"
@@ -84,11 +84,34 @@ function initEntitiesActions(store, router) {
hasLogo hasLogo
${campaignsFragment} ${campaignsFragment}
} }
connection: scenesConnection( }
connection: releasesConnection(
first: $limit first: $limit
offset: $offset offset: $offset
orderBy: $orderBy orderBy: $orderBy
filter: { 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: { effectiveDate: {
lessThan: $before, lessThan: $before,
greaterThan: $after greaterThan: $after
@@ -109,7 +132,7 @@ function initEntitiesActions(store, router) {
} }
totalCount totalCount
} }
} ${batchFragment}
} }
`, { `, {
entitySlug, entitySlug,
@@ -130,8 +153,8 @@ function initEntitiesActions(store, router) {
} }
return { return {
entity: curateEntity(entity, null, entity.connection.releases), entity: curateEntity(entity, null, connection.releases, { lastBatch: lastBatch?.id }),
totalCount: entity.connection.totalCount, totalCount: connection.totalCount,
}; };
} }

View File

@@ -70,6 +70,7 @@ const actorFields = `
ageFromBirth ageFromBirth
dateOfBirth dateOfBirth
gender gender
orientation
avatar: avatarMedia { avatar: avatarMedia {
id id
path path
@@ -165,27 +166,7 @@ const movieFields = `
} }
`; `;
const campaignsFragment = ` const campaignFields = `
campaigns(filter: {
or: [
{
banner: {
bannersTagsConnection: {
none: {
tag: {
slug: {
in: $exclude
}
}
}
}
}
}
{
bannerExists: false
}
]
}) {
id id
url url
affiliate { affiliate {
@@ -224,6 +205,30 @@ const campaignsFragment = `
slug slug
} }
} }
`;
const campaignsFragment = `
campaigns(filter: {
or: [
{
banner: {
bannersTagsConnection: {
none: {
tag: {
slug: {
in: $exclude
}
}
}
}
}
}
{
bannerExists: false
}
]
}) {
${campaignFields}
} }
`; `;
@@ -393,7 +398,6 @@ const releaseFields = `
slug slug
} }
} }
isNew
isFavorited isFavorited
isStashed(includeFavorites: false) isStashed(includeFavorites: false)
stashes: stashesScenesBySceneId( stashes: stashesScenesBySceneId(
@@ -413,22 +417,22 @@ const releaseFields = `
} }
} }
`; `;
// isNew too performance-intensive
const releasesFragment = ` const releasesFragment = `
connection: releasesConnection( connection: releasesConnection(
filter: { filter: {
releasesNotShowcasedsConnectionExist: false releasesNotShowcasedsConnectionExist: false
date: { effectiveDate: {
lessThan: $before, lessThan: $before,
greaterThan: $after greaterThan: $after
} }
releasesTagsConnection: { releasesTagsConnection: {
none: { none: {
tag: { tag: {
or: [ slug: {
{ slug: { in: $exclude } } in: $exclude
{ name: { in: $exclude } } }
]
} }
} }
} }
@@ -536,6 +540,7 @@ const releaseFragment = `
name name
slug slug
url url
showcased
} }
movies: moviesScenesBySceneId { movies: moviesScenesBySceneId {
movie { movie {
@@ -596,6 +601,12 @@ const releaseFragment = `
} }
`; `;
const batchFragment = `
batches(first: 1, orderBy: CREATED_AT_DESC) {
id
}
`;
function getIncludedEntities(router) { function getIncludedEntities(router) {
const includedChannels = router.currentRoute.value.query.channels ? router.currentRoute.value.query.channels.split(',') : []; 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(',') : []; const includedNetworks = router.currentRoute.value.query.networks ? router.currentRoute.value.query.networks.split(',') : [];
@@ -662,6 +673,8 @@ function getIncludedActors(router) {
export { export {
actorFields, actorFields,
actorStashesFields, actorStashesFields,
batchFragment,
campaignFields,
campaignsFragment, campaignsFragment,
mediaFields, mediaFields,
mediaFragment, mediaFragment,

View File

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

View File

@@ -8,6 +8,7 @@ import router from './router';
import initStore from './store'; import initStore from './store';
import initUiObservers from './ui/observers'; import initUiObservers from './ui/observers';
import initAuthObservers from './auth/observers'; import initAuthObservers from './auth/observers';
import setPageTitle from './set-page-title';
import { formatDate, formatDuration } from './format'; import { formatDate, formatDuration } from './format';
@@ -101,12 +102,7 @@ async function init() {
}, },
watch: { watch: {
pageTitle(title) { pageTitle(title) {
if (title) { setPageTitle(title); // for Options API components
document.title = `traxxx - ${title}`;
return;
}
document.title = 'traxxx';
}, },
}, },
beforeCreate() { beforeCreate() {

View File

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

View File

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

View File

@@ -1,5 +1,7 @@
import { createRouter, createWebHistory } from 'vue-router'; import { createRouter, createWebHistory } from 'vue-router';
import setPageTitle from './set-page-title';
import Home from '../components/home/home.vue'; import Home from '../components/home/home.vue';
import Login from '../components/auth/login.vue'; import Login from '../components/auth/login.vue';
import Signup from '../components/auth/signup.vue'; import Signup from '../components/auth/signup.vue';
@@ -233,7 +235,7 @@ const routes = [
name: 'notifications', name: 'notifications',
}, },
{ {
path: '/stash/:stashId/:stashSlug', path: '/stash/:username/:stashSlug',
redirect: (from) => ({ redirect: (from) => ({
name: 'stash', name: 'stash',
params: { params: {
@@ -244,7 +246,7 @@ const routes = [
}), }),
}, },
{ {
path: '/stash/:stashId/:stashSlug?/:range/:pageNumber', path: '/stash/:username/:stashSlug/:range/:pageNumber',
component: Stash, component: Stash,
name: 'stash', name: 'stash',
}, },
@@ -257,11 +259,17 @@ const routes = [
path: '/stats', path: '/stats',
component: Stats, component: Stats,
name: 'stats', name: 'stats',
meta: {
title: 'Stats',
},
}, },
{ {
path: '/not-found', path: '/not-found',
name: 'not-found', name: 'not-found',
component: NotFound, component: NotFound,
meta: {
title: 'Not Found',
},
}, },
{ {
path: '/:catchAll(.*)', path: '/:catchAll(.*)',
@@ -276,4 +284,6 @@ const router = createRouter({
routes, routes,
}); });
router.beforeEach((to) => setPageTitle(to.meta.title));
export default router; 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 { graphql } from '../api';
import { releaseFields } from '../fragments'; import { releaseFields } from '../fragments';
import { curateSite, curateRelease } from '../curate'; import { curateEntity, curateRelease } from '../curate';
import getDateRange from '../get-date-range'; import getDateRange from '../get-date-range';
function initSitesActions(store, _router) { function initSitesActions(store, _router) {
@@ -41,7 +41,7 @@ function initSitesActions(store, _router) {
} }
releasesConnection( releasesConnection(
filter: { filter: {
date: { effectiveDate: {
lessThan: $before, lessThan: $before,
greaterThan: $after, greaterThan: $after,
}, },
@@ -75,7 +75,7 @@ function initSitesActions(store, _router) {
equalTo: $siteSlug equalTo: $siteSlug
} }
} }
date: { effectiveDate: {
lessThan: $before, lessThan: $before,
greaterThan: $after greaterThan: $after
} }
@@ -103,13 +103,12 @@ function initSitesActions(store, _router) {
after, after,
before, before,
orderBy, orderBy,
isNew: store.getters.isNew,
exclude: store.state.ui.filter, exclude: store.state.ui.filter,
}); });
return { return {
site: curateSite(site), site: curateEntity(site),
releases: releases.map(release => curateRelease(release)), releases: releases.map((release) => curateRelease(release)),
totalCount, totalCount,
}; };
} }

View File

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

View File

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

View File

@@ -1,5 +1,12 @@
import { graphql, patch } from '../api'; import { graphql, patch } from '../api';
import { releaseFields, actorStashesFields } from '../fragments';
import {
releaseFields,
batchFragment,
campaignFields,
actorStashesFields,
} from '../fragments';
import { curateRelease, curateActor, curateNotification } from '../curate'; import { curateRelease, curateActor, curateNotification } from '../curate';
function initUiActions(store, _router) { function initUiActions(store, _router) {
@@ -218,6 +225,7 @@ function initUiActions(store, _router) {
} }
${actorStashesFields} ${actorStashesFields}
} }
${batchFragment}
} }
`, { `, {
query, query,
@@ -227,7 +235,7 @@ function initUiActions(store, _router) {
}); });
return { 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)) || [], actors: res?.actors.map((actor) => curateActor(actor)) || [],
}; };
} }
@@ -239,29 +247,7 @@ function initUiActions(store, _router) {
$maxRatio: BigFloat $maxRatio: BigFloat
) { ) {
randomCampaign: getRandomCampaign(minRatio: $minRatio, maxRatio: $maxRatio) { randomCampaign: getRandomCampaign(minRatio: $minRatio, maxRatio: $maxRatio) {
url ${campaignFields}
affiliate {
url
}
banner {
id
type
ratio
entity {
type
slug
parent {
type
slug
}
}
}
entity {
slug
}
parent {
slug
}
} }
} }
`, { `, {
@@ -272,6 +258,23 @@ function initUiActions(store, _router) {
return randomCampaign; 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() { async function fetchStats() {
const { const {
scenes, scenes,
@@ -279,23 +282,15 @@ function initUiActions(store, _router) {
actors, actors,
networks, networks,
channels, channels,
batches: [batch],
} = await graphql(` } = await graphql(`
query Stats { query Stats {
scenes: releasesConnection( scenes: releasesConnection { totalCount }
last: 1,
orderBy: BATCH_BY_CREATED_BATCH_ID__CREATED_AT_ASC
) {
totalCount
scenes: nodes {
batch: createdBatch {
createdAt
}
}
}
movies: moviesConnection { totalCount } movies: moviesConnection { totalCount }
actors: actorsConnection { totalCount } actors: actorsConnection { totalCount }
networks: entitiesConnection(filter: { type: { equalTo: "network" } }) { totalCount } networks: entitiesConnection(filter: { type: { equalTo: "network" } }) { totalCount }
channels: entitiesConnection(filter: { type: { equalTo: "channel" } }) { 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, totalActors: actors.totalCount,
totalNetworks: networks.totalCount, totalNetworks: networks.totalCount,
totalChannels: channels.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, setBatch,
setSfw, setSfw,
setTheme, setTheme,
fetchCampaign,
fetchRandomCampaign, fetchRandomCampaign,
fetchNotifications, fetchNotifications,
fetchStats, fetchStats,

View File

@@ -12,6 +12,8 @@ module.exports = {
password: 'password', password: 'password',
database: 'traxxx', database: 'traxxx',
}, },
timeout: 5000,
graphiql: false,
}, },
web: { web: {
host: '0.0.0.0', host: '0.0.0.0',
@@ -37,6 +39,8 @@ module.exports = {
auth: { auth: {
login: true, login: true,
signup: true, signup: true,
usernameLength: [2, 24],
usernamePattern: /^[a-zA-Z0-9_-]+$/,
}, },
exclude: { exclude: {
channels: [ channels: [
@@ -63,6 +67,10 @@ module.exports = {
'lowartfilms', 'lowartfilms',
// freeones // freeones
'freeones', 'freeones',
// new sesations
'tabutales',
'talesfromtheedge',
'shanedieselsbangingbabes',
// pornpros // pornpros
'milfhumiliation', 'milfhumiliation',
'humiliated', 'humiliated',
@@ -254,18 +262,21 @@ module.exports = {
'www.tushyraw.com', 'www.tushyraw.com',
'www.deeper.com', 'www.deeper.com',
'www.slayed.com', 'www.slayed.com',
'www.milfy.com',
'sthw-trailer-vixen.ssl-cdn.com', 'sthw-trailer-vixen.ssl-cdn.com',
'sthw-trailer-tushy.ssl-cdn.com', 'sthw-trailer-tushy.ssl-cdn.com',
'sthw-trailer-tushyraw.ssl-cdn.com', 'sthw-trailer-tushyraw.ssl-cdn.com',
'sthw-trailer-blacked.ssl-cdn.com', 'sthw-trailer-blacked.ssl-cdn.com',
'sthw-trailer-blackedraw.ssl-cdn.com', 'sthw-trailer-blackedraw.ssl-cdn.com',
'sthw-trailer-deeper.ssl-cdn.com', 'sthw-trailer-deeper.ssl-cdn.com',
'sthw-trailer-milfy.ssl-cdn.com',
'streamhw-trailer-vixen.ssl-cdn.com', 'streamhw-trailer-vixen.ssl-cdn.com',
'streamhw-trailer-tushy.ssl-cdn.com', 'streamhw-trailer-tushy.ssl-cdn.com',
'streamhw-trailer-tushyraw.ssl-cdn.com', 'streamhw-trailer-tushyraw.ssl-cdn.com',
'streamhw-trailer-blacked.ssl-cdn.com', 'streamhw-trailer-blacked.ssl-cdn.com',
'streamhw-trailer-blackedraw.ssl-cdn.com', 'streamhw-trailer-blackedraw.ssl-cdn.com',
'streamhw-trailer-deeper.ssl-cdn.com', 'streamhw-trailer-deeper.ssl-cdn.com',
'streamhw-trailer-milfy.ssl-cdn.com',
'cdn.vixen.com', 'cdn.vixen.com',
'cdn.tushy.com', 'cdn.tushy.com',
'cdn.blacked.com', 'cdn.blacked.com',
@@ -273,6 +284,7 @@ module.exports = {
'cdn.blackedraw.com', 'cdn.blackedraw.com',
'cdn.tushyraw.com', 'cdn.tushyraw.com',
'cdn.slayed.com', 'cdn.slayed.com',
'cdn.milfy.com',
'www.vogov.com', 'www.vogov.com',
'www.vogov.com', 'www.vogov.com',
'www.nubiles.net', 'www.nubiles.net',
@@ -297,6 +309,7 @@ module.exports = {
enable: false, enable: false,
hostnames: [ // these can run in the same browser session hostnames: [ // these can run in the same browser session
'www.kink.com', 'www.kink.com',
'store2.psmcdn.net', // Team Skeet API
], ],
}, },
cloudflare: { cloudflare: {
@@ -337,6 +350,10 @@ module.exports = {
}, },
media: { media: {
path: './media', path: './media',
transferSources: {
local: 'http://localhost:5000/media',
s3: 'https://cdn.traxxx.me',
},
maxSize: 1000, maxSize: 1000,
quality: 80, quality: 80,
thumbnailSize: 320, // width for 16:9 will be exactly 576px thumbnailSize: 320, // width for 16:9 will be exactly 576px
@@ -345,6 +362,8 @@ module.exports = {
lazyQuality: 90, lazyQuality: 90,
trailerQuality: [480, 540, 360, 720, 960, 1080, 320, 1440, 1600, 1920, 2160, 270, 240, 180], trailerQuality: [480, 540, 360, 720, 960, 1080, 320, 1440, 1600, 1920, 2160, 270, 240, 180],
limit: 25, // max number of photos per release 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 streamConcurrency: 2, // max number of video streams (m3u8 etc.) to fetch and process at once
}, },
titleSlugLength: 50, 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') table.boolean('independent')
.defaultTo(false); .defaultTo(false);
table.boolean('showcased');
table.boolean('visible') table.boolean('visible')
.defaultTo(true); .defaultTo(true);
@@ -272,6 +273,7 @@ exports.up = (knex) => Promise.resolve()
table.integer('age', 3); table.integer('age', 3);
table.text('gender', 18); table.text('gender', 18);
table.text('orientation');
table.text('description'); table.text('description');
table.text('birth_city'); table.text('birth_city');
@@ -345,6 +347,7 @@ exports.up = (knex) => Promise.resolve()
table.text('real_name'); table.text('real_name');
table.text('gender', 18); table.text('gender', 18);
table.text('orientation');
table.date('date_of_birth'); table.date('date_of_birth');
table.date('date_of_death'); table.date('date_of_death');
@@ -651,6 +654,8 @@ exports.up = (knex) => Promise.resolve()
table.integer('duration') table.integer('duration')
.unsigned(); .unsigned();
table.specificType('qualities', 'text[]');
table.boolean('deep'); table.boolean('deep');
table.text('deep_url', 1000); table.text('deep_url', 1000);
@@ -804,6 +809,8 @@ exports.up = (knex) => Promise.resolve()
table.text('original_tag'); table.text('original_tag');
table.unique(['tag_id', 'release_id']); table.unique(['tag_id', 'release_id']);
table.index('tag_id');
table.index('release_id');
})) }))
.then(() => knex.schema.createTable('releases_search', (table) => { .then(() => knex.schema.createTable('releases_search', (table) => {
table.integer('release_id', 16) table.integer('release_id', 16)
@@ -873,6 +880,8 @@ exports.up = (knex) => Promise.resolve()
table.datetime('created_at') table.datetime('created_at')
.defaultTo(knex.fn.now()); .defaultTo(knex.fn.now());
table.index('scene_id');
})) }))
.then(() => knex.schema.createTable('movies_covers', (table) => { .then(() => knex.schema.createTable('movies_covers', (table) => {
table.integer('movie_id', 16) table.integer('movie_id', 16)
@@ -916,12 +925,151 @@ exports.up = (knex) => Promise.resolve()
table.unique('movie_id'); 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) => { .then(() => knex.schema.createTable('movies_search', (table) => {
table.integer('movie_id', 16) table.integer('movie_id', 16)
.references('id') .references('id')
.inTable('movies') .inTable('movies')
.onDelete('cascade'); .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) => { .then(() => knex.schema.createTable('chapters', (table) => {
table.increments('id', 16); table.increments('id', 16);
@@ -1062,6 +1210,8 @@ exports.up = (knex) => Promise.resolve()
table.datetime('created_at') table.datetime('created_at')
.notNullable() .notNullable()
.defaultTo(knex.fn.now()); .defaultTo(knex.fn.now());
table.datetime('last_login');
})) }))
.then(() => knex.schema.createTable('stashes', (table) => { .then(() => knex.schema.createTable('stashes', (table) => {
table.increments('id'); table.increments('id');
@@ -1088,7 +1238,12 @@ exports.up = (knex) => Promise.resolve()
table.datetime('created_at') table.datetime('created_at')
.notNullable() .notNullable()
.defaultTo(knex.fn.now()); .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) => { .then(() => knex.schema.createTable('stashes_scenes', (table) => {
table.integer('stash_id') table.integer('stash_id')
.notNullable() .notNullable()
@@ -1152,6 +1307,27 @@ exports.up = (knex) => Promise.resolve()
.notNullable() .notNullable()
.defaultTo(knex.fn.now()); .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) => { .then(() => knex.schema.createTable('alerts', (table) => {
table.increments('id'); table.increments('id');
@@ -1329,6 +1505,9 @@ exports.up = (knex) => Promise.resolve()
.notNullable() .notNullable()
.defaultTo(knex.fn.now()); .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) => { .then(() => knex.schema.createTable('banners_tags', (table) => {
table.increments('id'); table.increments('id');
@@ -1372,17 +1551,46 @@ exports.up = (knex) => Promise.resolve()
.notNullable() .notNullable()
.defaultTo(knex.fn.now()); .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 // SEARCH AND SORT
.then(() => { // eslint-disable-line arrow-body-style .then(() => { // eslint-disable-line arrow-body-style
// allow vim fold // allow vim fold
return knex.raw(` return knex.raw(`
ALTER TABLE releases_search ADD COLUMN document tsvector; ALTER TABLE releases_search ADD COLUMN document tsvector;
ALTER TABLE movies_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 */ /* allow scenes without dates to be mixed inbetween scenes with dates */
ALTER TABLE releases ALTER TABLE releases
ADD COLUMN effective_date timestamptz ADD COLUMN effective_date timestamptz
GENERATED ALWAYS AS (COALESCE(date, created_at)) STORED; 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 // INDEXES
@@ -1401,6 +1609,8 @@ exports.up = (knex) => Promise.resolve()
CREATE UNIQUE INDEX movies_search_unique ON movies_search (movie_id); CREATE UNIQUE INDEX movies_search_unique ON movies_search (movie_id);
CREATE INDEX releases_search_index ON releases_search USING GIN (document); CREATE INDEX releases_search_index ON releases_search USING GIN (document);
CREATE INDEX movies_search_index ON movies_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 // 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 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 $$ CREATE FUNCTION search_releases(query text) RETURNS SETOF releases_search_results AS $$
SELECT releases.id, ranks.rank FROM ( SELECT results.release_id, ts_rank(results.document::tsvector, curate_search_query(query)) as rank
SELECT FROM (
releases_search.release_id, SELECT releases_search.release_id, document
ts_rank(releases_search.document, to_tsquery('english', array_to_string(array(SELECT * FROM regexp_matches(query, '[A-Za-zÀ-ÖØ-öø-ÿ0-9]+', 'g')), '|'))) AS rank
FROM releases_search FROM releases_search
) ranks WHERE document::tsvector @@ curate_search_query(query)
LEFT JOIN releases ON releases.id = ranks.release_id ) AS results
WHERE ranks.rank > 0 ORDER BY rank DESC;
ORDER BY ranks.rank DESC;
$$ LANGUAGE SQL STABLE; $$ LANGUAGE SQL STABLE;
CREATE FUNCTION search_movies(query text) RETURNS SETOF movies_search_results AS $$ 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; ORDER BY actors.name;
$$ LANGUAGE SQL STABLE; $$ 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, /* 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 */ 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 $$ 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 ORDER BY tags.priority DESC
$$ LANGUAGE SQL STABLE; $$ 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.* SELECT media.*
FROM movies_scenes FROM movies_scenes
LEFT JOIN 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); SELECT EXISTS(SELECT true WHERE (SELECT id FROM batches ORDER BY created_at DESC LIMIT 1) = release.created_batch_id);
$$ LANGUAGE sql STABLE; $$ LANGUAGE sql STABLE;
CREATE FUNCTION banners_ratio(banner banners) RETURNS numeric AS $$ CREATE FUNCTION series_actors(serie series) RETURNS SETOF actors AS $$
SELECT ROUND(banner.width::decimal / banner.height::decimal, 2); 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; $$ LANGUAGE SQL STABLE;
CREATE FUNCTION get_random_campaign() RETURNS SETOF campaigns AS $$ CREATE FUNCTION series_tags(serie series) RETURNS SETOF tags AS $$
SELECT * FROM campaigns SELECT tags.*
ORDER BY random() 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; 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 // POLICIES
@@ -1632,6 +1982,7 @@ exports.up = (knex) => Promise.resolve()
ALTER TABLE stashes_scenes ENABLE ROW LEVEL SECURITY; ALTER TABLE stashes_scenes ENABLE ROW LEVEL SECURITY;
ALTER TABLE stashes_movies ENABLE ROW LEVEL SECURITY; ALTER TABLE stashes_movies ENABLE ROW LEVEL SECURITY;
ALTER TABLE stashes_actors 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_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()); 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) 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 ENABLE ROW LEVEL SECURITY;
ALTER TABLE alerts_tags ENABLE ROW LEVEL SECURITY; ALTER TABLE alerts_tags ENABLE ROW LEVEL SECURITY;
ALTER TABLE alerts_scenes 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), 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 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_scenes CASCADE;
DROP TABLE IF EXISTS movies_covers CASCADE; DROP TABLE IF EXISTS movies_covers CASCADE;
DROP TABLE IF EXISTS movies_posters 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 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_tags CASCADE;
DROP TABLE IF EXISTS clips_posters CASCADE; DROP TABLE IF EXISTS clips_posters CASCADE;
DROP TABLE IF EXISTS clips_photos 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_tags CASCADE;
DROP TABLE IF EXISTS banners CASCADE; DROP TABLE IF EXISTS banners CASCADE;
DROP TABLE IF EXISTS campaigns CASCADE; DROP TABLE IF EXISTS campaigns CASCADE;
DROP TABLE IF EXISTS random_campaign CASCADE;
DROP TABLE IF EXISTS affiliates CASCADE; DROP TABLE IF EXISTS affiliates CASCADE;
DROP TABLE IF EXISTS batches 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 movies CASCADE;
DROP TABLE IF EXISTS clips CASCADE; DROP TABLE IF EXISTS clips CASCADE;
DROP TABLE IF EXISTS chapters CASCADE; DROP TABLE IF EXISTS chapters CASCADE;
DROP TABLE IF EXISTS series CASCADE;
DROP TABLE IF EXISTS releases CASCADE; DROP TABLE IF EXISTS releases CASCADE;
DROP TABLE IF EXISTS actors CASCADE; DROP TABLE IF EXISTS actors CASCADE;
DROP TABLE IF EXISTS tags 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 get_random_sfw_media_id;
DROP FUNCTION IF EXISTS releases_is_new; 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_tags;
DROP FUNCTION IF EXISTS actors_channels; DROP FUNCTION IF EXISTS actors_channels;
DROP FUNCTION IF EXISTS actors_actors; 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_actors;
DROP FUNCTION IF EXISTS movies_tags; 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;
DROP POLICY IF EXISTS stashes_policy ON stashes_scenes; 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", "name": "traxxx",
"version": "1.225.10", "version": "1.228.33",
"description": "All the latest porn releases in one place", "description": "All the latest porn releases in one place",
"main": "src/app.js", "main": "src/app.js",
"scripts": { "scripts": {
@@ -48,55 +48,49 @@
"babel-loader": "^8.0.6", "babel-loader": "^8.0.6",
"babel-preset-airbnb": "^5.0.0", "babel-preset-airbnb": "^5.0.0",
"css-loader": "^6.5.0", "css-loader": "^6.5.0",
"eslint": "^8.1.0", "eslint": "^8.44.0",
"eslint-config-airbnb": "^18.2.1", "eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-base": "^14.2.1", "eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.20.1", "eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.18.3", "eslint-plugin-react": "^7.18.3",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"eslint-watch": "^7.0.0", "eslint-watch": "^8.0.0",
"eslint-webpack-plugin": "^3.1.0", "eslint-webpack-plugin": "^3.1.0",
"mini-css-extract-plugin": "^2.4.3", "mini-css-extract-plugin": "^2.4.3",
"node-sass": "^6.0.1", "node-sass": "^6.0.1",
"postcss-loader": "^6.2.0", "postcss-loader": "^6.2.0",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"sass-loader": "^12.3.0", "sass-loader": "^12.3.0",
"style-loader": "^3.3.1",
"vue-loader": "^16.8.2", "vue-loader": "^16.8.2",
"webpack": "^5.11.0", "webpack": "^5.11.0",
"webpack-cli": "^4.9.1" "webpack-cli": "^4.9.1"
}, },
"dependencies": { "dependencies": {
"@casl/ability": "^5.2.2",
"@graphile-contrib/pg-order-by-related": "^1.0.0-beta.6", "@graphile-contrib/pg-order-by-related": "^1.0.0-beta.6",
"@graphile-contrib/pg-simplify-inflector": "^6.1.0", "@graphile-contrib/pg-simplify-inflector": "^6.1.0",
"@graphile/pg-aggregates": "^0.1.1",
"acorn": "^8.0.4",
"array-equal": "^1.0.0", "array-equal": "^1.0.0",
"aws-sdk": "^2.847.0", "aws-sdk": "^2.847.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"bhttp": "^1.2.8", "bhttp": "^1.2.8",
"blake2": "^4.0.0", "blake2": "^4.0.0",
"bluebird": "^3.7.2", "bluebird": "^3.7.2",
"body-parser": "^1.19.0",
"bottleneck": "^2.19.5", "bottleneck": "^2.19.5",
"canvas": "^2.6.1", "canvas": "^2.11.2",
"casual": "^1.6.2", "casual": "^1.6.2",
"cheerio": "^1.0.0-rc.3", "cheerio": "^1.0.0-rc.3",
"cli-confirm": "^1.0.1", "cli-confirm": "^1.0.1",
"cloudscraper": "^4.6.0",
"config": "^3.2.5", "config": "^3.2.5",
"connect-session-knex": "^2.0.0", "connect-session-knex": "^2.0.0",
"convert": "^4.2.4", "convert": "^4.2.4",
"cookie": "^0.4.0", "cookie": "^0.4.0",
"csv-stringify": "^5.3.6", "csv-stringify": "^5.3.6",
"date-fns": "^2.30.0",
"dayjs": "^1.8.21", "dayjs": "^1.8.21",
"dompurify": "^2.0.11", "dompurify": "^2.0.11",
"ejs": "^3.0.1", "ejs": "^3.0.1",
"express": "^4.17.1", "express": "^4.17.1",
"express-promise-router": "^4.1.0", "express-promise-router": "^4.1.0",
"express-react-views": "^0.11.0",
"express-session": "^1.17.1", "express-session": "^1.17.1",
"face-api.js": "^0.22.2", "face-api.js": "^0.22.2",
"faker": "^5.1.0", "faker": "^5.1.0",
@@ -112,37 +106,29 @@
"jsdom": "^18.0.0", "jsdom": "^18.0.0",
"knex": "^0.95.12", "knex": "^0.95.12",
"knex-migrate": "^1.7.4", "knex-migrate": "^1.7.4",
"longjohn": "^0.2.12",
"mime": "^2.4.4", "mime": "^2.4.4",
"mitt": "^3.0.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"nanoid": "^3.1.30", "nanoid": "^3.1.30",
"node-fetch": "^2.6.7", "node-fetch": "^2.6.7",
"object-merge-advanced": "^12.1.0", "object-merge-advanced": "^12.1.0",
"object.omit": "^3.0.0", "object.omit": "^3.0.0",
"opn": "^6.0.0",
"pg": "^8.5.1", "pg": "^8.5.1",
"postgraphile": "^4.13.0", "postgraphile": "^4.13.0",
"postgraphile-plugin-connection-filter": "^2.2.2", "postgraphile-plugin-connection-filter": "^2.2.2",
"promise-task-queue": "^1.2.0", "promise-task-queue": "^1.2.0",
"prop-types": "^15.7.2", "puppeteer": "^20.5.0",
"puppeteer": "^18.2.0", "puppeteer-extra": "^3.3.6",
"puppeteer-extra": "^3.3.4", "puppeteer-extra-plugin-stealth": "^2.11.2",
"puppeteer-extra-plugin-stealth": "^2.11.1",
"sharp": "^0.29.2", "sharp": "^0.29.2",
"showdown": "^1.9.1", "showdown": "^1.9.1",
"source-map-support": "^0.5.16", "source-map-support": "^0.5.16",
"template-format": "^1.2.5", "template-format": "^1.2.5",
"tippy.js": "^6.3.1",
"tough-cookie": "^4.0.0", "tough-cookie": "^4.0.0",
"tunnel": "0.0.6", "tunnel": "0.0.6",
"ua-parser-js": "^1.0.32", "ua-parser-js": "^1.0.32",
"undici": "^4.13.0", "unprint": "^0.10.1",
"unprint": "^0.8.2",
"url-pattern": "^1.0.3", "url-pattern": "^1.0.3",
"v-tooltip": "^2.0.3", "v-tooltip": "^2.0.3",
"video.js": "^7.11.4",
"videojs-vr": "^1.7.1",
"vue": "^3.2.20", "vue": "^3.2.20",
"vue-router": "^4.0.12", "vue-router": "^4.0.12",
"vuex": "^4.0.2", "vuex": "^4.0.2",

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