Displaying actor-specific scene tags.
This commit is contained in:
@@ -140,20 +140,27 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul
|
<div
|
||||||
v-if="scene.tags.length > 0"
|
v-for="actorTags in tags"
|
||||||
class="tags nolist"
|
:key="`tags-${actorTags.actor?.name || 'scene'}`"
|
||||||
>
|
>
|
||||||
<li
|
<ul class="tags nolist">
|
||||||
v-for="tag in scene.tags"
|
<li
|
||||||
:key="`tag-${tag.id}`"
|
v-if="actorTags.actor"
|
||||||
>
|
class="tags-actor"
|
||||||
<Link
|
>{{ actorTags.actor.name }}:</li>
|
||||||
:href="`/tag/${tag.slug}`"
|
|
||||||
class="tag nolink"
|
<li
|
||||||
>{{ tag.name }}</Link>
|
v-for="tag in actorTags.tags"
|
||||||
</li>
|
:key="`tag-${tag.id}`"
|
||||||
</ul>
|
>
|
||||||
|
<Link
|
||||||
|
:href="`/tag/${tag.slug}`"
|
||||||
|
class="tag nolink"
|
||||||
|
>{{ tag.name }}</Link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="scene.movies.length > 0 || scene.series.length > 0"
|
v-if="scene.movies.length > 0 || scene.series.length > 0"
|
||||||
@@ -440,6 +447,17 @@ const {
|
|||||||
|
|
||||||
const { scene } = pageProps;
|
const { scene } = pageProps;
|
||||||
|
|
||||||
|
const tags = [
|
||||||
|
...scene.actors.map((actor) => ({
|
||||||
|
actor,
|
||||||
|
tags: scene.tags.filter((tag) => tag.actorId === actor.id),
|
||||||
|
})),
|
||||||
|
{
|
||||||
|
tags: scene.tags.filter((tag) => tag.actorId === null),
|
||||||
|
actor: null,
|
||||||
|
},
|
||||||
|
].filter((actorTags) => actorTags.tags.length > 0);
|
||||||
|
|
||||||
const showSummaryDialog = ref(false);
|
const showSummaryDialog = ref(false);
|
||||||
|
|
||||||
const qualities = {
|
const qualities = {
|
||||||
@@ -640,6 +658,11 @@ function copySummary() {
|
|||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tags-actor {
|
||||||
|
margin-right: .5rem;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
.actors {
|
.actors {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ function curateScene(rawScene, assets, reqUser, context) {
|
|||||||
slug: tag.slug,
|
slug: tag.slug,
|
||||||
name: censor(tag.name, context.restriction),
|
name: censor(tag.name, context.restriction),
|
||||||
priority: tag.priority,
|
priority: tag.priority,
|
||||||
|
actorId: tag.actor_id,
|
||||||
})),
|
})),
|
||||||
chapters: assets.chapters.map((chapter) => ({
|
chapters: assets.chapters.map((chapter) => ({
|
||||||
id: chapter.id,
|
id: chapter.id,
|
||||||
@@ -218,7 +219,7 @@ export async function fetchScenesById(sceneIds, { reqUser, ...context } = {}) {
|
|||||||
.whereIn('release_id', sceneIds)
|
.whereIn('release_id', sceneIds)
|
||||||
.leftJoin('actors as directors', 'directors.id', 'releases_directors.director_id'),
|
.leftJoin('actors as directors', 'directors.id', 'releases_directors.director_id'),
|
||||||
tags: knex('releases_tags')
|
tags: knex('releases_tags')
|
||||||
.select('tags.id', 'slug', 'name', 'priority', 'release_id')
|
.select('tags.id', 'slug', 'name', 'priority', 'release_id', 'actor_id')
|
||||||
.leftJoin('tags', 'tags.id', 'releases_tags.tag_id')
|
.leftJoin('tags', 'tags.id', 'releases_tags.tag_id')
|
||||||
.whereNotNull('tags.id')
|
.whereNotNull('tags.id')
|
||||||
.whereIn('release_id', sceneIds)
|
.whereIn('release_id', sceneIds)
|
||||||
|
|||||||
2
static
2
static
Submodule static updated: 305454e97a...a91edb84a1
Reference in New Issue
Block a user