commit
09837c660b
|
@ -390,7 +390,7 @@ final class GameRepo(val coll: Coll)(implicit ec: scala.concurrent.ExecutionCont
|
|||
else g
|
||||
val userIds = g2.userIds.distinct
|
||||
val fen: Option[FEN] = initialFen orElse {
|
||||
(!g2.variant.standardInitialPosition)
|
||||
(g2.variant.fromPosition || g2.variant.chess960)
|
||||
.option(Forsyth >> g2.chess)
|
||||
.filterNot(_.initial)
|
||||
}
|
||||
|
|
|
@ -30,11 +30,4 @@ private object Chess960 {
|
|||
case _ => false
|
||||
}(Rank.Eighth)
|
||||
}
|
||||
|
||||
def fixVariantName(v: String) =
|
||||
v.toLowerCase match {
|
||||
case "chess 960" => "chess960"
|
||||
case "fisherandom" => "chess960" // I swear, sometimes...
|
||||
case _ => v
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,12 +55,11 @@ case class ImportData(pgn: String, analyse: Option[String]) {
|
|||
}
|
||||
|
||||
def preprocess(user: Option[String]): Validated[String, Preprocessed] = ImporterForm.catchOverflow { () =>
|
||||
Parser.full(pgn) flatMap { parsed =>
|
||||
Parser.full(pgn) map { parsed =>
|
||||
Reader.fullWithSans(
|
||||
pgn,
|
||||
sans => sans.copy(value = sans.value take maxPlies),
|
||||
Tags.empty
|
||||
) map evenIncomplete map { case replay @ Replay(setup, _, state) =>
|
||||
parsed,
|
||||
sans => sans.copy(value = sans.value take maxPlies)
|
||||
) pipe evenIncomplete pipe { case replay @ Replay(setup, _, state) =>
|
||||
val initBoard = parsed.tags.fen flatMap Forsyth.<< map (_.board)
|
||||
val fromPosition = initBoard.nonEmpty && !parsed.tags.fen.exists(_.initial)
|
||||
val variant = {
|
||||
|
|
Loading…
Reference in New Issue