feat(live): show language-scoped stream variants

Keep live stream variant expansion scoped to the selected language while preserving the legacy all-language variants response when no language is provided.

Display projected current EPG programme data in live rows and distinguish selected streams from actively playing streams in the collapsed variant UI.

Refs #43

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-08 19:00:14 +02:00
parent 9e6b1d4593
commit 8f2825f697
9 changed files with 298 additions and 11 deletions

View File

@ -67,12 +67,19 @@ router.get('/channels', requireAuth, async (req, res) => {
});
router.get('/channels/:logicalChannelId/variants', requireAuth, (req, res) => {
const language = req.query.language === undefined
? null
: String(req.query.language).trim().toLowerCase();
if (language !== null && !/^(?:[a-z]{2,3}|und)$/.test(language)) {
return res.status(400).json({ error: 'language must be a valid language code' });
}
try {
const page = Number.parseInt(req.query.page, 10) || 1;
const limit = Number.parseInt(req.query.limit, 10) || 100;
const includeHidden = req.query.includeHidden === 'true';
return res.json(liveProjection.getChannelVariants({
logicalChannelId: req.params.logicalChannelId,
language,
includeHidden,
userId: req.user.id,
page,