add broadcast PGN endpoints

pull/9874/head
Thibault Duplessis 2021-09-23 10:48:01 +02:00
parent 63c22ae53c
commit f467bac4ab
3 changed files with 8 additions and 3 deletions

View File

@ -163,6 +163,9 @@ final class RelayRound(
}
)
def pgn(ts: String, rs: String, id: String) = studyC.pgn(id)
def apiPgn(id: String) = studyC.apiPgn(id)
def stream(id: String) = AnonOrScoped() { req => me =>
env.relay.api.byIdWithStudy(id) flatMap {
_ ?? { rt =>

View File

@ -213,6 +213,8 @@ GET /broadcast/round/$roundId<\w{8}>/edit controllers.RelayRound.edit(roundI
POST /broadcast/round/$roundId<\w{8}>/edit controllers.RelayRound.update(roundId: String)
POST /broadcast/round/$roundId<\w{8}>/reset controllers.RelayRound.reset(roundId: String)
POST /broadcast/round/$roundId<\w{8}>/push controllers.RelayRound.push(roundId: String)
GET /broadcast/:ts/:rs/$roundId<\w{8}>.pgn controllers.RelayRound.pgn(ts: String, rs: String, roundId: String)
GET /api/broadcast/round/$roundId<\w{8}>.pgn controllers.RelayRound.apiPgn(roundId: String)
GET /api/stream/broadcast/round/$roundId<\w{8}>.pgn controllers.RelayRound.stream(roundId: String)
# Learn

View File

@ -108,7 +108,7 @@ export function view(ctrl: StudyShareCtrl): VNode {
{
attrs: {
'data-icon': '',
href: `/study/${studyId}.pgn`,
href: ctrl.relay ? `${ctrl.relay.roundPath()}.pgn` : `/study/${studyId}.pgn`,
download: true,
},
},
@ -140,8 +140,8 @@ export function view(ctrl: StudyShareCtrl): VNode {
h('form.form3', [
...(ctrl.relay
? [
['broadcastUrl', `${ctrl.relay.tourPath()}`],
['currentRoundUrl', `${ctrl.relay.roundPath()}`],
['broadcastUrl', ctrl.relay.tourPath()],
['currentRoundUrl', ctrl.relay.roundPath()],
['currentGameUrl', `${ctrl.relay.roundPath()}/${chapter.id}`],
]
: [