forked from DebaucheryLibrarian/traxxx
Refactored various modules for entities. Updated and refactored Kink scraper.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
:to="{ name: 'actors', params: { gender: 'male', letter } }"
|
||||
:class="{ selected: gender === 'male' }"
|
||||
class="gender-link male"
|
||||
replace
|
||||
><Gender gender="male" /></router-link>
|
||||
</li>
|
||||
<li class="gender">
|
||||
@@ -21,6 +22,7 @@
|
||||
:to="{ name: 'actors', params: { gender: 'trans', letter } }"
|
||||
:class="{ selected: gender === 'trans' }"
|
||||
class="gender-link transsexual"
|
||||
replace
|
||||
><Gender gender="transsexual" /></router-link>
|
||||
</li>
|
||||
<li class="gender">
|
||||
@@ -28,6 +30,7 @@
|
||||
:to="{ name: 'actors', params: { gender: 'other', letter } }"
|
||||
:class="{ selected: gender === 'other' }"
|
||||
class="gender-link other"
|
||||
replace
|
||||
><Icon icon="question5" /></router-link>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -42,6 +45,7 @@
|
||||
:to="{ name: 'actors', params: { gender, letter: letterX } }"
|
||||
:class="{ selected: letterX === letter }"
|
||||
class="letter-link"
|
||||
replace
|
||||
>{{ letterX || 'All' }}</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -130,30 +130,22 @@ import FilterBar from '../header/filter-bar.vue';
|
||||
import Releases from '../releases/releases.vue';
|
||||
import Sites from '../sites/sites.vue';
|
||||
import Network from '../tile/network.vue';
|
||||
import Entity from '../tile/entity.vue';
|
||||
|
||||
async function fetchNetwork() {
|
||||
const { network, totalCount } = await this.$store.dispatch('fetchNetworkBySlug', {
|
||||
networkSlug: this.$route.params.networkSlug,
|
||||
const { entity, totalCount } = await this.$store.dispatch('fetchEntityBySlugAndType', {
|
||||
entitySlug: this.$route.params.networkSlug,
|
||||
entityType: 'network',
|
||||
limit: this.limit,
|
||||
range: this.$route.params.range,
|
||||
pageNumber: Number(this.$route.params.pageNumber),
|
||||
});
|
||||
|
||||
this.network = network;
|
||||
this.totalCount = totalCount;
|
||||
|
||||
if (this.network.studios) {
|
||||
this.studios = this.network.studios.map(studio => ({
|
||||
...studio,
|
||||
network: this.network,
|
||||
}));
|
||||
}
|
||||
|
||||
this.networks = this.network.networks;
|
||||
this.sites = this.network.sites
|
||||
.filter(site => !site.independent);
|
||||
|
||||
this.network = entity;
|
||||
this.networks = this.network.children;
|
||||
this.releases = this.network.releases;
|
||||
|
||||
this.totalCount = totalCount;
|
||||
}
|
||||
|
||||
async function route() {
|
||||
@@ -171,6 +163,7 @@ export default {
|
||||
Releases,
|
||||
Sites,
|
||||
Network,
|
||||
Entity,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="networks">
|
||||
<form
|
||||
class="search"
|
||||
@submit.prevent="searchSites"
|
||||
@submit.prevent="searchEntities"
|
||||
>
|
||||
<input
|
||||
v-model="query"
|
||||
:placeholder="`Find ${siteCount} sites in ${networks.length} networks`"
|
||||
class="query"
|
||||
@input="searchSites"
|
||||
@input="searchEntities"
|
||||
>
|
||||
|
||||
<button
|
||||
@@ -19,12 +19,12 @@
|
||||
|
||||
<div
|
||||
v-if="query.length"
|
||||
class="network-tiles"
|
||||
class="entity-tiles"
|
||||
>
|
||||
<Site
|
||||
v-for="site in searchResults"
|
||||
:key="`site-tile-${site.slug}`"
|
||||
:site="site"
|
||||
<Entity
|
||||
v-for="entity in searchResults"
|
||||
:key="`${entity.type}-tile-${entity.slug}`"
|
||||
:entity="entity"
|
||||
/>
|
||||
|
||||
<span v-if="searchResults.length === 0">No results for "{{ query }}"</span>
|
||||
@@ -32,41 +32,39 @@
|
||||
|
||||
<div
|
||||
v-if="query.length === 0"
|
||||
class="network-tiles"
|
||||
class="entity-tiles"
|
||||
>
|
||||
<Network
|
||||
<Entity
|
||||
v-for="network in networks"
|
||||
:key="`network-tile-${network.slug}`"
|
||||
:network="network"
|
||||
:entity="network"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Network from '../tile/network.vue';
|
||||
import Site from '../tile/site.vue';
|
||||
import Entity from '../tile/entity.vue';
|
||||
|
||||
async function searchSites() {
|
||||
this.searchResults = await this.$store.dispatch('searchSites', {
|
||||
async function searchEntities() {
|
||||
this.searchResults = await this.$store.dispatch('searchEntities', {
|
||||
query: this.query,
|
||||
limit: 20,
|
||||
limit: 50,
|
||||
});
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
this.networks = await this.$store.dispatch('fetchNetworks');
|
||||
this.networks = await this.$store.dispatch('fetchEntities', { type: 'network' });
|
||||
this.pageTitle = 'Networks';
|
||||
}
|
||||
|
||||
function siteCount() {
|
||||
return this.networks.map(network => network.sites).flat().length;
|
||||
return this.networks.map(network => network.children).flat().length;
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Network,
|
||||
Site,
|
||||
Entity,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -81,7 +79,7 @@ export default {
|
||||
},
|
||||
mounted,
|
||||
methods: {
|
||||
searchSites,
|
||||
searchEntities,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -135,7 +133,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.network-tiles {
|
||||
.entity-tiles {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
|
||||
grid-gap: 1rem;
|
||||
|
||||
@@ -211,25 +211,15 @@
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="link added"
|
||||
>{{ formatDate(release.dateAdded, 'MMMM D, YYYY') }}</a>
|
||||
>{{ formatDate(release.createdAt, 'MMMM D, YYYY HH:mm') }}</a>
|
||||
</span>
|
||||
|
||||
<div class="row">
|
||||
<Icon icon="paste2" />
|
||||
|
||||
<input
|
||||
class="filename"
|
||||
:value="filename"
|
||||
@focus="copyFilename"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import config from 'config';
|
||||
import format from 'template-format';
|
||||
// import config from 'config';
|
||||
// import format from 'template-format';
|
||||
|
||||
import Banner from './banner.vue';
|
||||
import Actor from '../tile/actor.vue';
|
||||
@@ -240,13 +230,9 @@ function pageTitle() {
|
||||
return this.release && this.release.title;
|
||||
}
|
||||
|
||||
function copyFilename(event) {
|
||||
event.target.setSelectionRange(0, event.target.value.length);
|
||||
document.execCommand('copy');
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
this.release = await this.$store.dispatch('fetchReleaseById', this.$route.params.releaseId);
|
||||
/*
|
||||
this.filename = format(config.filename.pattern, {
|
||||
...this.release,
|
||||
shootId: this.release.shootId || '',
|
||||
@@ -254,6 +240,7 @@ async function mounted() {
|
||||
}, {
|
||||
spreadSeparator: config.filename.separator,
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -273,9 +260,6 @@ export default {
|
||||
pageTitle,
|
||||
},
|
||||
mounted,
|
||||
methods: {
|
||||
copyFilename,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
74
assets/components/tile/entity.vue
Normal file
74
assets/components/tile/entity.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<a
|
||||
:href="`/${entity.type}/${entity.slug}`"
|
||||
:title="entity.name"
|
||||
class="tile"
|
||||
>
|
||||
<img
|
||||
v-if="entity.type === 'channel'"
|
||||
:src="`/img/logos/${entity.parent.slug}/thumbs/${entity.slug}.png`"
|
||||
:alt="entity.name"
|
||||
class="logo"
|
||||
>
|
||||
|
||||
<img
|
||||
v-else
|
||||
:src="`/img/logos/${entity.slug}/thumbs/network.png`"
|
||||
:alt="entity.name"
|
||||
class="logo"
|
||||
>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
entity: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import 'theme';
|
||||
|
||||
.tile {
|
||||
height: 6rem;
|
||||
background: $tile;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: .5rem 1rem;
|
||||
border-radius: .25rem;
|
||||
box-shadow: 0 0 3px rgba(0, 0, 0, .25);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.link {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.logo {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
color: $text-contrast;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
filter: $logo-highlight;
|
||||
}
|
||||
|
||||
.title {
|
||||
color: $text;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,33 +1,33 @@
|
||||
<template>
|
||||
<a
|
||||
:href="`/network/${network.slug}`"
|
||||
:title="network.name"
|
||||
class="tile"
|
||||
:class="{ sfw }"
|
||||
>
|
||||
<img
|
||||
:src="`/img/logos/${network.slug}/thumbs/network.png`"
|
||||
:alt="network.name"
|
||||
class="logo"
|
||||
>
|
||||
</a>
|
||||
<a
|
||||
:href="`/network/${network.slug}`"
|
||||
:title="network.name"
|
||||
class="tile"
|
||||
:class="{ sfw }"
|
||||
>
|
||||
<img
|
||||
:src="`/img/logos/${network.slug}/thumbs/network.png`"
|
||||
:alt="network.name"
|
||||
class="logo lazy"
|
||||
>
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
function sfw() {
|
||||
return this.$store.state.ui.sfw;
|
||||
return this.$store.state.ui.sfw;
|
||||
}
|
||||
|
||||
export default {
|
||||
props: {
|
||||
network: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
sfw,
|
||||
},
|
||||
props: {
|
||||
network: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
sfw,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
background: var(--profile);
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: .5rem 1rem;
|
||||
@@ -52,16 +52,9 @@ export default {
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: $text;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
object-fit: contain;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
/* filter: $logo-highlight; */
|
||||
}
|
||||
|
||||
.title {
|
||||
|
||||
Reference in New Issue
Block a user