Showing teaser of trailer is not available on scene page.

This commit is contained in:
DebaucheryLibrarian 2024-06-04 00:44:28 +02:00
parent 988ee9bdcf
commit 774f171c5c
4 changed files with 23 additions and 12 deletions

View File

@ -3,10 +3,19 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,interactive-widget=resizes-content" /> <link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon/favicon-16x16.png">
<link rel="manifest" href="/img/favicon/site.webmanifest">
<link rel="mask-icon" href="/img/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/img/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#b91d47">
<meta name="msapplication-config" content="/img/favicon/browserconfig.xml">
<meta name="theme-color" content="#f65596"> <meta name="theme-color" content="#f65596">
<title>traxxx - consent</title> <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,interactive-widget=resizes-content" />
<title>traxxx - Consent</title>
<style> <style>
:root { :root {
--primary: #f65596; --primary: #f65596;

View File

@ -36,7 +36,7 @@
> >
<img <img
v-if="network.hasLogo" v-if="network.hasLogo"
:src="`/logos/${network.slug}/network.png`" :src="network.type === 'network' || network.isIndependent || !network.parent ? `/logos/${network.slug}/network.png` : `/logos/${network.parent.slug}/${network.slug}.png`"
:alt="network.name" :alt="network.name"
class="logo" class="logo"
> >
@ -44,7 +44,7 @@
<span v-else>{{ network.name }}</span> <span v-else>{{ network.name }}</span>
<Icon <Icon
v-if="query && network.type === 'network'" v-if="pageContext.urlParsed.search.q && network.type === 'network'"
icon="device_hub" icon="device_hub"
/> />
</a> </a>

View File

@ -7,11 +7,11 @@
> >
<div class="banner"> <div class="banner">
<div <div
v-if="scene.trailer" v-if="scene.trailer || scene.teaser"
class="trailer" class="trailer"
> >
<Player <Player
:video="scene.trailer" :video="scene.trailer || scene.teaser"
:poster="poster" :poster="poster"
class="item" class="item"
:class="{ playing }" :class="{ playing }"

View File

@ -25,28 +25,30 @@ export function curateEntity(entity, context) {
export async function fetchEntities(options) { export async function fetchEntities(options) {
const entities = await knex('entities') const entities = await knex('entities')
.select('entities.*', knex.raw('row_to_json(parents) as parent'))
.modify((builder) => { .modify((builder) => {
if (options.query) { if (options.query) {
builder.where((whereBuilder) => { builder.where((whereBuilder) => {
whereBuilder whereBuilder
.whereILike('name', `%${options.query}%`) .whereILike('entities.name', `%${options.query}%`)
.orWhereILike('slug', `%${options.query}%`); .orWhereILike('entities.slug', `%${options.query}%`);
}); });
} }
if (options.type === 'primary') { if (options.type === 'primary') {
builder builder
.where('type', 'network') .where('entities.type', 'network')
.orWhere('independent', true) .orWhere('entities.independent', true)
.orWhereNull('parent_id'); .orWhereNull('entities.parent_id');
return; return;
} }
if (options.type) { if (options.type) {
builder.where('type', options.type); builder.where('entities.type', options.type);
} }
}) })
.leftJoin('entities as parents', 'parents.id', 'entities.parent_id')
.orderBy(...(options.order || ['name', 'asc'])) .orderBy(...(options.order || ['name', 'asc']))
.limit(options.limit || 1000); .limit(options.limit || 1000);