parent
47ce4ea0b0
commit
ab9c17b927
|
@ -21,9 +21,17 @@ case class RelayGame(
|
|||
def finished = end.isDefined
|
||||
|
||||
def isEmpty = tags.value.isEmpty && root.children.nodes.isEmpty
|
||||
|
||||
lazy val looksLikeLichess = tags(_.Site) exists { site =>
|
||||
RelayGame.lichessDomains exists { domain =>
|
||||
site startsWith s"https://$domain/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private object RelayGame {
|
||||
|
||||
val lichessDomains = List("lichess.org", "lichess.dev")
|
||||
|
||||
val staticTags = List("white", "black", "round", "event", "site")
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ final private class RelaySync(
|
|||
chapters: List[Chapter],
|
||||
nbGames: Int
|
||||
): Option[Chapter] =
|
||||
if (nbGames == 1) chapters find game.staticTagsMatch
|
||||
if (nbGames == 1 || game.looksLikeLichess) chapters find game.staticTagsMatch
|
||||
else chapters.find(_.relay.exists(_.index == game.index))
|
||||
|
||||
private def updateChapter(study: Study, chapter: Chapter, game: RelayGame): Fu[NbMoves] =
|
||||
|
|
Loading…
Reference in New Issue