Added dedicated stash page. Using preview tiles for stashes on user page.

This commit is contained in:
DebaucheryLibrarian
2021-03-19 02:36:31 +01:00
parent cc27f202af
commit f0265c2f5d
13 changed files with 470 additions and 36 deletions

View File

@@ -58,6 +58,10 @@ async function init() {
}
function getPath(media, type, options) {
if (!media) {
return null;
}
const path = getBasePath(media, type, options);
const filename = getFilename(media, type, options);

View File

@@ -12,6 +12,7 @@ import Actors from '../components/actors/actors.vue';
import Movies from '../components/releases/movies.vue';
import Tag from '../components/tags/tag.vue';
import Tags from '../components/tags/tags.vue';
import Stash from '../components/stashes/stash.vue';
import Search from '../components/search/search.vue';
import Stats from '../components/stats/stats.vue';
import NotFound from '../components/errors/404.vue';
@@ -201,6 +202,11 @@ const routes = [
component: Tags,
name: 'tags',
},
{
path: '/stash/:stashId/:stashSlug?',
component: Stash,
name: 'stash',
},
{
path: '/search',
component: Search,

View File

@@ -1,6 +1,62 @@
import { post, del } from '../api';
import { graphql, post, del } from '../api';
import { releaseFields } from '../fragments';
import { curateStash } from '../curate';
function initStashesActions(_store, _router) {
async function fetchStash(context, stashId) {
const { stash } = await graphql(`
query Stash(
$stashId: Int!
) {
stash(id: $stashId) {
id
name
slug
public
user {
id
username
}
actors: stashesActors {
comment
actor {
id
name
slug
gender
age
ageFromBirth
dateOfBirth
birthCity
birthState
birthCountry: countryByBirthCountryAlpha2 {
alpha2
name
alias
}
avatar: avatarMedia {
id
path
thumbnail
lazy
}
}
}
scenes: stashesScenes {
comment
scene {
${releaseFields}
}
}
}
}
`, {
stashId: Number(stashId),
});
return curateStash(stash);
}
async function stashActor(context, { actorId, stashId }) {
await post(`/stashes/${stashId}/actors`, { actorId });
}
@@ -26,6 +82,7 @@ function initStashesActions(_store, _router) {
}
return {
fetchStash,
stashActor,
stashScene,
stashMovie,

View File

@@ -42,7 +42,7 @@ function initUsersActions(_store, _router) {
}
}
}
scenes: stashesScenes {
scenes: stashesScenes(first: 20) {
comment
scene {
${releaseFields}