forked from DebaucheryLibrarian/traxxx
Modularized release component between movie and scene. Added Kink Classics channel.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { graphql } from '../api';
|
||||
import { releasesFragment, releaseFragment } from '../fragments';
|
||||
import { releasesFragment, releaseFragment, releaseFields } from '../fragments';
|
||||
import { curateRelease } from '../curate';
|
||||
import getDateRange from '../get-date-range';
|
||||
|
||||
@@ -56,7 +56,7 @@ function initReleasesActions(store, _router) {
|
||||
connection: moviesConnection(
|
||||
first: $limit
|
||||
offset: $offset
|
||||
orderBy: DATE_ASC
|
||||
orderBy: DATE_DESC
|
||||
) {
|
||||
movies: nodes {
|
||||
id
|
||||
@@ -109,10 +109,83 @@ function initReleasesActions(store, _router) {
|
||||
};
|
||||
}
|
||||
|
||||
async function fetchMovieById({ _commit }, movieId) {
|
||||
// const release = await get(`/releases/${releaseId}`);
|
||||
|
||||
const { movie } = await graphql(`
|
||||
query Movie($movieId: Int!) {
|
||||
movie(id: $movieId) {
|
||||
id
|
||||
title
|
||||
slug
|
||||
url
|
||||
date
|
||||
actors {
|
||||
id
|
||||
name
|
||||
age
|
||||
dateOfBirth
|
||||
birthCountry: countryByBirthCountryAlpha2 {
|
||||
alpha2
|
||||
name
|
||||
alias
|
||||
}
|
||||
avatar: avatarMedia {
|
||||
id
|
||||
path
|
||||
thumbnail
|
||||
lazy
|
||||
}
|
||||
}
|
||||
covers: moviesCoversByReleaseId {
|
||||
media {
|
||||
id
|
||||
path
|
||||
thumbnail
|
||||
}
|
||||
}
|
||||
trailer: moviesTrailerByReleaseId {
|
||||
media {
|
||||
id
|
||||
path
|
||||
}
|
||||
}
|
||||
scenes: moviesScenes {
|
||||
scene {
|
||||
${releaseFields}
|
||||
}
|
||||
}
|
||||
tags {
|
||||
id
|
||||
slug
|
||||
name
|
||||
}
|
||||
entity {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
parent {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
movieId: Number(movieId),
|
||||
});
|
||||
|
||||
return curateRelease(movie);
|
||||
}
|
||||
|
||||
return {
|
||||
fetchReleases,
|
||||
fetchReleaseById,
|
||||
fetchMovies,
|
||||
fetchMovieById,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user