Show currently playing album in page title

This commit is contained in:
Cadence Ember 2025-08-17 15:09:28 +12:00
parent 878e0b3aef
commit e7cba4703c
2 changed files with 4 additions and 2 deletions

View file

@ -1,3 +1,4 @@
title= `⯈ ${item_title} | ${band_name} | BC Explorer`
#player
.s-sidebarwidget(style="overflow: hidden")
div(style="margin: -1px; margin-bottom: -11px").ps-relative

View file

@ -1,6 +1,6 @@
// @ts-check
const {sync, router} = require("../passthrough")
const {sync, router, select} = require("../passthrough")
const {defineEventHandler} = require("h3")
const {getValidatedRouterParams} = require("h3")
@ -11,7 +11,8 @@ const pugSync = sync.require("../pug-sync")
const schema = sync.require("./schema")
const play = defineEventHandler(async event => {
const locals = await getValidatedRouterParams(event, schema.schema.play.parse)
const params = await getValidatedRouterParams(event, schema.schema.play.parse)
const locals = {...params, ...select("item", ["item_title", "band_name"], {item_id: params.item_id}).get()}
return pugSync.render(event, "player.pug", locals)
})