Added channel filter.

This commit is contained in:
DebaucheryLibrarian
2020-07-20 04:20:33 +02:00
parent 5291a87587
commit 0e4c0d8fff
143 changed files with 537 additions and 302 deletions

View File

@@ -12,6 +12,7 @@ function initActorActions(store, router) {
range = 'latest',
}) {
const { before, after, orderBy } = getDateRange(range);
const includeChannels = router.currentRoute.query.channels ? router.currentRoute.query.channels.split(',') : [];
const includeTags = router.currentRoute.query.tags ? router.currentRoute.query.tags.split(',') : [];
const mode = router.currentRoute.query.mode || 'all';
@@ -26,6 +27,7 @@ function initActorActions(store, router) {
$selectableTags: [String],
$includeTags: [String!],
$mode: String!,
${includeChannels.length > 0 ? '$includeChannels: [String!]' : ''}
) {
actor(id: $actorId) {
id
@@ -146,12 +148,31 @@ function initActorActions(store, router) {
slug
priority
}
channels {
id
name
slug
type
independent
parent {
id
name
slug
type
}
}
scenesConnection(
filter: {
date: {
lessThan: $before,
greaterThan: $after,
}
${includeChannels.length > 0 ? `
entity: {
slug: {
in: $includeChannels
}
}` : ''}
}
selectedTags: $includeTags
mode: $mode
@@ -176,6 +197,7 @@ function initActorActions(store, router) {
orderBy,
excludeTags: store.state.ui.filter,
includeTags,
includeChannels,
mode,
});