Skip to content

Commit f40645f

Browse files
committed
allow exporting gif with rating but no player name - closes #19191
also make Options a final class
1 parent 8368b0b commit f40645f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

modules/game/src/main/GifExport.scala

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,16 @@ object GifExport:
2323
case class UpstreamStatus(code: Int) extends lila.core.lilaism.LilaException:
2424
val message = s"gif service status: $code"
2525

26-
case class Options(
27-
players: Boolean = true,
28-
ratings: Boolean = true,
29-
clocks: Boolean = true,
30-
glyphs: Boolean = true
31-
):
32-
def makeSense = copy(ratings = players && ratings)
26+
final class Options(val players: Boolean, val ratings: Boolean, val clocks: Boolean, val glyphs: Boolean)
3327
object Options:
34-
val default = Options()
28+
val default = Options(true, true, true, true)
3529
def fromReq(using RequestHeader): Options =
3630
Options(
3731
players = queryStringBoolOpt("players") | default.players,
3832
ratings = queryStringBoolOpt("ratings") | default.ratings,
3933
clocks = queryStringBoolOpt("clocks") | default.clocks,
4034
glyphs = queryStringBoolOpt("glyphs") | default.glyphs
41-
).makeSense
35+
)
4236

4337
final class GifExport(
4438
ws: StandaloneWSClient,

0 commit comments

Comments
 (0)