File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -84,4 +84,5 @@ eval-cache drop standard 8/8/1k6/8/2K5/1P6/8/8 w - - 0 1
84
84
disposable test msumain.edu.ph
85
85
disposable reload msumain.edu.ph
86
86
video sheet
87
+ puzzle issue {id} {issue}
87
88
"""
Original file line number Diff line number Diff line change @@ -46,9 +46,6 @@ final private[api] class Cli(
46
46
case None =>
47
47
fuccess :
48
48
" Invalid announce. Format: `announce <length> <unit> <words...>` or just `announce cancel` to cancel it"
49
- case " puzzle" :: " opening" :: " recompute" :: " all" :: Nil =>
50
- puzzle.opening.recomputeAll
51
- fuccess(" started in background" )
52
49
case " threads" :: Nil =>
53
50
fuccess :
54
51
val threads = ornicar.scalalib.Jvm .threadGroups()
@@ -70,6 +67,7 @@ final private[api] class Cli(
70
67
studySearch.cli.process orElse
71
68
evalCache.cli.process orElse
72
69
plan.cli.process orElse
70
+ puzzle.cli.process orElse
73
71
msg.cli.process orElse
74
72
video.cli.process orElse
75
73
team.cli.process orElse
Original file line number Diff line number Diff line change @@ -85,6 +85,15 @@ final class Env(
85
85
86
86
private lazy val tagger = wire[PuzzleTagger ]
87
87
88
+ def cli = new lila.common.Cli :
89
+ def process =
90
+ case " puzzle" :: " opening" :: " recompute" :: " all" :: Nil =>
91
+ opening.recomputeAll
92
+ fuccess(" started in background" )
93
+ case " puzzle" :: " issue" :: id :: issue :: Nil =>
94
+ api.puzzle.setIssue(PuzzleId (id), issue) map : res =>
95
+ if res then " done" else " not found"
96
+
88
97
scheduler.scheduleAtFixedRate(10 minutes, 1 day): () =>
89
98
tagger.addAllMissing
90
99
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ final class PuzzleApi(
33
33
MaxPerPage (30 )
34
34
)
35
35
36
+ def setIssue (id : PuzzleId , issue : String ): Fu [Boolean ] =
37
+ colls.puzzle(_.updateField($id(id), Puzzle .BSONFields .issue, issue).map(_.n > 0 ))
38
+
36
39
private [puzzle] object round :
37
40
38
41
def find (user : User , puzzleId : PuzzleId ): Fu [Option [PuzzleRound ]] =
You can’t perform that action at this time.
0 commit comments