Added alert dialog. Fixed image rotation EXIT data being discarded.
This commit is contained in:
@@ -424,6 +424,94 @@ function initActorActions(store, router) {
|
||||
};
|
||||
}
|
||||
|
||||
async function searchActors({ _commit }, { query, limit = 20, minLength = 2 }) {
|
||||
const { actors } = await graphql(`
|
||||
query SearchActors(
|
||||
$query: String!
|
||||
$limit: Int = 20
|
||||
$minLength: Int = 2
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
) {
|
||||
actors: searchActors(
|
||||
search: $query,
|
||||
minLength: $minLength
|
||||
first: $limit
|
||||
) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
age
|
||||
ageAtDeath
|
||||
dateOfBirth
|
||||
dateOfDeath
|
||||
gender
|
||||
aliasFor: actorByAliasFor {
|
||||
id
|
||||
name
|
||||
slug
|
||||
age
|
||||
ageAtDeath
|
||||
dateOfBirth
|
||||
dateOfDeath
|
||||
gender
|
||||
entity {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
avatar: avatarMedia {
|
||||
id
|
||||
path
|
||||
thumbnail
|
||||
lazy
|
||||
isS3
|
||||
width
|
||||
height
|
||||
comment
|
||||
credit
|
||||
}
|
||||
birthCountry: countryByBirthCountryAlpha2 {
|
||||
alpha2
|
||||
name
|
||||
alias
|
||||
}
|
||||
}
|
||||
entity {
|
||||
id
|
||||
name
|
||||
slug
|
||||
}
|
||||
avatar: avatarMedia {
|
||||
id
|
||||
path
|
||||
thumbnail
|
||||
lazy
|
||||
isS3
|
||||
width
|
||||
height
|
||||
comment
|
||||
credit
|
||||
}
|
||||
birthCountry: countryByBirthCountryAlpha2 {
|
||||
alpha2
|
||||
name
|
||||
alias
|
||||
}
|
||||
${actorStashesFields}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
query,
|
||||
limit,
|
||||
minLength,
|
||||
hasAuth: !!store.state.auth.user,
|
||||
userId: store.state.auth.user?.id,
|
||||
});
|
||||
|
||||
return actors.map(actor => curateActor(actor));
|
||||
}
|
||||
|
||||
async function fetchActorReleases({ _commit }, actorId) {
|
||||
const releases = await get(`/actors/${actorId}/releases`, {
|
||||
filter: store.state.ui.filter,
|
||||
@@ -438,6 +526,7 @@ function initActorActions(store, router) {
|
||||
fetchActorById,
|
||||
fetchActors,
|
||||
fetchActorReleases,
|
||||
searchActors,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -250,6 +250,7 @@ function initEntitiesActions(store, router) {
|
||||
search: $query,
|
||||
first: $limit
|
||||
) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
|
||||
@@ -280,9 +280,10 @@ const releasesFragment = `
|
||||
releasesTagsConnection: {
|
||||
none: {
|
||||
tag: {
|
||||
slug: {
|
||||
in: $exclude
|
||||
}
|
||||
or: [
|
||||
{ slug: { in: $exclude } }
|
||||
{ name: { in: $exclude } }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,6 +211,72 @@ function initTagsActions(store, _router) {
|
||||
return tags.map(tag => curateTag(tag, store.state.ui.sfw));
|
||||
}
|
||||
|
||||
async function searchTags({ _commit }, {
|
||||
limit = 100,
|
||||
minLength = 2,
|
||||
query,
|
||||
_group,
|
||||
_priority,
|
||||
}) {
|
||||
const { tags } = await graphql(`
|
||||
query SearchTags(
|
||||
$query: String!,
|
||||
$limit: Int = 100
|
||||
$minLength: Int = 2
|
||||
) {
|
||||
tags: searchTags(
|
||||
search: $query,
|
||||
first: $limit
|
||||
minLength: $minLength
|
||||
) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
poster: tagsPosterByTagId {
|
||||
media {
|
||||
thumbnail
|
||||
comment
|
||||
lazy
|
||||
width
|
||||
height
|
||||
thumbnailWidth
|
||||
thumbnailHeight
|
||||
entity {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
independent
|
||||
parent {
|
||||
id
|
||||
name
|
||||
slug
|
||||
type
|
||||
independent
|
||||
}
|
||||
}
|
||||
sfw: sfwMedia {
|
||||
thumbnail
|
||||
comment
|
||||
lazy
|
||||
}
|
||||
}
|
||||
}
|
||||
group {
|
||||
name
|
||||
slug
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {
|
||||
query,
|
||||
limit,
|
||||
minLength,
|
||||
});
|
||||
|
||||
return tags.map(tag => curateTag(tag, store.state.ui.sfw));
|
||||
}
|
||||
|
||||
async function fetchTagReleases({ _commit }, tagId) {
|
||||
const releases = await get(`/tags/${tagId}/releases`, {
|
||||
filter: store.state.ui.filter,
|
||||
@@ -225,6 +291,7 @@ function initTagsActions(store, _router) {
|
||||
fetchTagBySlug,
|
||||
fetchTags,
|
||||
fetchTagReleases,
|
||||
searchTags,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { graphql } from '../api';
|
||||
import { graphql, post, del } from '../api';
|
||||
import { releaseFields } from '../fragments';
|
||||
import { curateUser } from '../curate';
|
||||
|
||||
@@ -66,8 +66,18 @@ function initUsersActions(store, _router) {
|
||||
return curateUser(user);
|
||||
}
|
||||
|
||||
async function addAlert(context, alert) {
|
||||
return post('/alerts', alert);
|
||||
}
|
||||
|
||||
async function removeAlert(context, alertId) {
|
||||
return del(`/alerts/${alertId}`);
|
||||
}
|
||||
|
||||
return {
|
||||
addAlert,
|
||||
fetchUser,
|
||||
removeAlert,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user