Fixed fallback watch URL not generated for scenes without URL or network.

This commit is contained in:
2026-03-20 01:42:00 +01:00
parent e6919a4283
commit 928857596f
3 changed files with 5 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ function getWatchUrl(scene) {
return new URL(scene.url).href; return new URL(scene.url).href;
} }
if (scene.channel && (scene.channel.isIndependent || scene.channel.type === 'network')) { if (scene.channel && (scene.channel.isIndependent || scene.channel.type === 'network' || !scene.network)) {
return new URL(scene.channel.url).href; return new URL(scene.channel.url).href;
} }

View File

@@ -45,6 +45,7 @@ function curateScene(rawScene, assets, reqUser, context) {
slug: assets.channel.slug, slug: assets.channel.slug,
name: censor(assets.channel.name, context.restriction), name: censor(assets.channel.name, context.restriction),
type: assets.channel.type, type: assets.channel.type,
url: assets.channel.url,
isIndependent: assets.channel.independent, isIndependent: assets.channel.independent,
hasLogo: assets.channel.has_logo, hasLogo: assets.channel.has_logo,
}, },
@@ -52,6 +53,7 @@ function curateScene(rawScene, assets, reqUser, context) {
id: assets.channel.network_id, id: assets.channel.network_id,
slug: assets.channel.network_slug, slug: assets.channel.network_slug,
name: censor(assets.channel.network_name, context.restriction), name: censor(assets.channel.network_name, context.restriction),
url: assets.network_url,
type: assets.channel.network_type, type: assets.channel.network_type,
hasLogo: assets.channel.network_has_logo, hasLogo: assets.channel.network_has_logo,
} : null, } : null,
@@ -179,6 +181,7 @@ export async function fetchScenesById(sceneIds, { reqUser, ...context } = {}) {
'networks.slug as network_slug', 'networks.slug as network_slug',
'networks.name as network_name', 'networks.name as network_name',
'networks.type as network_type', 'networks.type as network_type',
'networks.url as network_url',
'networks.has_logo as network_has_logo', 'networks.has_logo as network_has_logo',
knex.raw('row_to_json(affiliates) as affiliate'), knex.raw('row_to_json(affiliates) as affiliate'),
) )

2
static

Submodule static updated: d9fd99c504...cc66e52e24