Merge branch 'master' into ublog-lang

* master:
  move broadcast PGN endpoint to /api/
  button to download all rounds of a broadcast
  broadcast stream download endpoint
pull/9768/head
Thibault Duplessis 2021-09-09 21:23:08 +02:00
commit 4c992b7bf0
5 changed files with 16 additions and 2 deletions

View File

@ -19,6 +19,6 @@ object bits {
val i18nKeys: List[lila.i18n.MessageKey] = {
import trans.broadcast._
List(addRound, broadcastUrl, currentRoundUrl, currentGameUrl).map(_.key)
List(addRound, broadcastUrl, currentRoundUrl, currentGameUrl, downloadAllRounds).map(_.key)
}
}

View File

@ -200,7 +200,7 @@ GET /broadcast controllers.RelayTour.index(page:
GET /broadcast/new controllers.RelayTour.form
POST /broadcast/new controllers.RelayTour.create
GET /broadcast/:rs/$anyId<\w{8}> controllers.RelayTour.redirectOrApiTour(rs: String, anyId: String)
GET /broadcast/$tourId<\w{8}>.pgn controllers.RelayTour.pgn(tourId: String)
GET /api/broadcast/$tourId<\w{8}>.pgn controllers.RelayTour.pgn(tourId: String)
GET /broadcast/$tourId<\w{8}>/edit controllers.RelayTour.edit(tourId: String)
POST /broadcast/$tourId<\w{8}>/edit controllers.RelayTour.update(tourId: String)
GET /broadcast/$tourId<\w{8}>/new controllers.RelayRound.form(tourId: String)

View File

@ -1509,6 +1509,7 @@ val `deleteRound` = new I18nKey("broadcast:deleteRound")
val `broadcastUrl` = new I18nKey("broadcast:broadcastUrl")
val `currentRoundUrl` = new I18nKey("broadcast:currentRoundUrl")
val `currentGameUrl` = new I18nKey("broadcast:currentGameUrl")
val `downloadAllRounds` = new I18nKey("broadcast:downloadAllRounds")
}
object streamer {

View File

@ -24,4 +24,5 @@
<string name="broadcastUrl">Broadcast URL</string>
<string name="currentRoundUrl">Current round URL</string>
<string name="currentGameUrl">Current game URL</string>
<string name="downloadAllRounds">Download all rounds</string>
</resources>

View File

@ -91,6 +91,18 @@ export function view(ctrl: StudyShareCtrl): VNode {
ctrl.trans.noarg('cloneStudy')
)
: null,
ctrl.relay &&
h(
'a.button.text',
{
attrs: {
'data-icon': '',
href: `/api/broadcast/${ctrl.relay.data.tour.id}.pgn`,
download: true,
},
},
ctrl.trans.noarg('downloadAllRounds')
),
h(
'a.button.text',
{