From 37041028907dd2625b8ae34aa4bb3ead1dcd9ddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Gl=C3=B3rias?= <9739913+SergioGlorias@users.noreply.github.com> Date: Thu, 15 Aug 2024 20:55:24 +0100 Subject: [PATCH] Update Broadcast Create Form #358 --- doc/specs/schemas/BroadcastForm.yaml | 76 +++++++++++---- doc/specs/schemas/BroadcastRoundForm.yaml | 95 +++++++++++++++++++ .../broadcast-broadcastTournamentId-new.yaml | 44 +-------- ...broadcast-round-broadcastRoundId-edit.yaml | 43 +-------- 4 files changed, 154 insertions(+), 104 deletions(-) create mode 100644 doc/specs/schemas/BroadcastRoundForm.yaml diff --git a/doc/specs/schemas/BroadcastForm.yaml b/doc/specs/schemas/BroadcastForm.yaml index f1cadf7c..f9fe4a60 100644 --- a/doc/specs/schemas/BroadcastForm.yaml +++ b/doc/specs/schemas/BroadcastForm.yaml @@ -20,44 +20,82 @@ properties: type: string description: | Mention up to 4 of the best players participating. - autoLeaderboard: - type: boolean - description: Compute and display a simple leaderboard based on game results markdown: type: string - description: Optional long description of the broadcast. Markdown is supported. Length must be less than 20,000 characters. - tier: - type: integer + description: | + Optional long description of the broadcast. Markdown is supported. Length must be less than 20,000 characters. + autoLeaderboard: + type: boolean + description: | + Compute and display a simple leaderboard based on game results + teamTable: + type: boolean description: | - Optional, for Lichess admins only, used to feature on /broadcast. - - * `3` for normal - * `4` for high - * `5` for best + Show a team leaderboard. Requires WhiteTeam and BlackTeam PGN tags. players: + type: string description: | Optional replace player names, ratings and titles. One line per player, formatted as such: - `player name = FIDE ID` + ```txt + player name = FIDE ID + ``` Example: - `Magnus Carlsen = 1503014` + ```txt + Magnus Carlsen = 1503014 + ``` - Player names ignore case and punctuation, and match all possible combinations of 2 words: - "Jorge Rick Vito" will match "Jorge Rick", "jorge vito", "Rick, Vito", etc. + Player names ignore case and punctuation, and match all possible combinations of 2 words: "Jorge Rick Vito" will match "Jorge Rick", "jorge vito", "Rick, Vito", etc. + + If the player is NM or WNM, you can: + + ```txt + Player Name = FIDE ID / Title + ``` Alternatively, you may set tags manually, like so: - `player name / rating / title / new name` + ```txt + player name / rating / title / new name + ``` All values are optional. Example: + ```txt + Magnus Carlsen / 2863 / GM + YouGotLittUp / 1890 / / Louis Litt + ``` + teams: + type: string + description: | + Optional: assign players to teams + + One line per player, formatted as such: + ```txt + Team name; Fide Id or Player name + ``` + + Example: + ```txt + Team Cats ; 3408230 + Team Dogs ; Scooby Doo + ``` + + By default the PGN tags WhiteTeam and BlackTeam are used. + tier: + type: integer + description: | + Optional, for Lichess admins only, used to feature on /broadcast. - `Magnus Carlsen / 2863 / GM` - `YouGotLittUp / 1890 / / Louis Litt` + * `3` for Official: normal tier + * `4` for Official: high tier + * `5` for Official: best tier + * `-1` for Private + + required: - name - - description diff --git a/doc/specs/schemas/BroadcastRoundForm.yaml b/doc/specs/schemas/BroadcastRoundForm.yaml new file mode 100644 index 00000000..87814f94 --- /dev/null +++ b/doc/specs/schemas/BroadcastRoundForm.yaml @@ -0,0 +1,95 @@ +type: object +properties: + name: + type: string + description: | + Name of the broadcast round. Length must be between 3 and 80 characters. + Example: `Round 1` + syncUrl: + type: string + description: | + URL that Lichess will poll to get updates about the games. It must be publicly accessible from the Internet. + Example: + ```txt + https://myserver.org/myevent/round-10/games.pgn + ``` + Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush) + syncUrls: + type: string + description: | + URLs that Lichess will poll to get updates about the games. It must be publicly accessible from the Internet. + Example: + ```txt + https://myserver.org/myevent/round-10/game-1.pgn + https://myserver.org/myevent/round-10/game-2.pgn + ``` + Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush) + syncIds: + type: string + description: | + Lichess game IDs - Up to 64 Lichess game IDs, separated by spaces. + Choose one between `syncUrl`, `syncUrls` and `syncIds`, if it is missing, the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush) + onlyRound: + type: integer + maximum: 999 + minimum: 1 + description: | + Filter games by round number + + Optional, only keep games from the source that match a round number. + It uses the PGN **Round** tag. These would match round 3: + ```txt + [Round "3"] + [Round "3.1"] + ``` + If you set a round number, then games without a **Round** tag are dropped. + + It only works if you chose `syncUrl` or `syncUrls` as the source. + slices: + type: string + description: | + Select slices of the games + + Optional. Select games based on their position in the source. + ```txt + 1 only select the first board + 1-4 only select the first 4 boards + 1,2,3,4 same as above, first 4 boards + 11-15,21-25 boards 11 to 15, and boards 21 to 25 + 2,3,7-9 boards 2, 3, 7, 8, and 9 + ``` + Slicing is done after filtering by round number. + + It only works if you chose `syncUrl` or `syncUrls` as the source. + startsAt: + type: integer + description: | + Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round. + Example: `1356998400070` + minimum: 1356998400070 + startsAfterPrevious: + type: boolean + description: | + The start date is unknown, and the round will start automatically when the previous round completes. + default: false + delay: + type: integer + description: | + Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it. + Example: `900` (15 min) + minimum: 0 + maximum: 3600 + finished: + type: boolean + description: | + Mark whether the round has been completed. + default: false + period: + type: integer + description: | + (Only for Admins) Waiting time for each poll. + minimum: 2 + maximum: 60 + +required: + - name \ No newline at end of file diff --git a/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-new.yaml b/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-new.yaml index b733e742..76eb4d36 100644 --- a/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-new.yaml +++ b/doc/specs/tags/broadcasts/broadcast-broadcastTournamentId-new.yaml @@ -20,49 +20,7 @@ post: content: application/x-www-form-urlencoded: schema: - type: object - properties: - name: - type: string - description: | - Name of the broadcast round. Length must be between 3 and 80 characters. - Example: `Round 1` - syncUrl: - type: string - description: | - URL that Lichess will poll to get updates about the games. It must be publicly accessible from the Internet. - Example: `https://myserver.org/myevent/round-10/games.pgn` - If the syncUrl is missing, then the broadcast needs to be fed by [pushing PGN to it](#operation/broadcastPush). - syncUrlRound: - type: string - description: | - Required if `syncUrl` contains a livechesscloud link. - startsAt: - type: integer - description: | - Timestamp in milliseconds of broadcast round start. Leave empty to manually start the broadcast round. - Example: `1356998400070` - minimum: 1356998400070 - delay: - type: integer - description: | - Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it. - Example: `900` (15 min) - minimum: 0 - maximum: 1800 - period: - type: integer - description: | - (Only for Admins) Waiting time for each poll. - minimum: 2 - maximum: 60 - finished: - type: boolean - description: | - Mark whether the round has been completed. - default: false - required: - - name + $ref: '../../schemas/BroadcastRoundForm.yaml' responses: "200": description: The broadcast round was successfully created. diff --git a/doc/specs/tags/broadcasts/broadcast-round-broadcastRoundId-edit.yaml b/doc/specs/tags/broadcasts/broadcast-round-broadcastRoundId-edit.yaml index c50d0566..2ede7067 100644 --- a/doc/specs/tags/broadcasts/broadcast-round-broadcastRoundId-edit.yaml +++ b/doc/specs/tags/broadcasts/broadcast-round-broadcastRoundId-edit.yaml @@ -22,48 +22,7 @@ post: content: application/x-www-form-urlencoded: schema: - type: object - properties: - name: - type: string - description: | - Name of the broadcast round. Length must be between 3 and 80 characters. - Example: `Round 10` - syncUrl: - type: string - description: | - URL that Lichess will poll to get updates about the games. It must be publicly accessible from the Internet. - Example: `https://myserver.org/myevent/round-10/games.pgn` - syncUrlRound: - type: string - description: | - Required if `syncUrl` contains a livechesscloud link. - startsAt: - type: integer - description: | - Timestamp in milliseconds of broadcast start. Leave empty to manually start the broadcast. - Example: `1356998400070` - minimum: 1356998400070 - delay: - type: integer - description: | - Delay in seconds for movements to appear on the broadcast. Leave it empty if you don't need it. - Example: `900` (15 min) - minimum: 0 - maximum: 1800 - period: - type: integer - description: | - (Only for Admins) Waiting time for each poll. - minimum: 2 - maximum: 60 - finished: - type: boolean - description: | - Mark whether the round has been completed. - default: false - required: - - name + $ref: '../../schemas/BroadcastRoundForm.yaml' responses: "200": description: The broadcast round was successfully edited.