This commit is contained in:
Thibault Duplessis 2017-10-10 16:08:48 -05:00
parent eaa4ad022b
commit fb58a97ee4
2 changed files with 2 additions and 10 deletions

View file

@ -86,7 +86,7 @@ private final class RelaySync(
private def updateChapterTags(study: Study, chapter: Chapter, game: RelayGame): Funit = {
val gameTags = game.tags.value.foldLeft(Tags(Nil)) {
case (newTags, tag) =>
if (!chapter.tags.value.exists(equalTags(tag))) newTags + tag
if (!chapter.tags.value.exists(tag ==)) newTags + tag
else newTags
}
val tags = game.end
@ -105,14 +105,6 @@ private final class RelaySync(
}.void
}
private def equalTags(t1: Tag)(t2: Tag): Boolean =
(t1.name == t2.name) && {
t1.value == t2.value || {
t1.name == Tag.Result && normalizeDrawNotation(t1) == normalizeDrawNotation(t2)
}
}
private def normalizeDrawNotation(t: Tag): String = t.value.replace("1/2", "½")
private def createChapter(study: Study, game: RelayGame): Fu[Chapter] =
chapterRepo.nextOrderByStudy(study.id) flatMap { order =>
val name = {

View file

@ -29,7 +29,7 @@ object Dependencies {
val hasher = "com.roundeights" %% "hasher" % "1.2.0"
val jodaTime = "joda-time" % "joda-time" % "2.9.9"
val chess = "org.lichess" %% "scalachess" % "6.18"
val chess = "org.lichess" %% "scalachess" % "6.20"
val maxmind = "com.sanoma.cda" %% "maxmind-geoip2-scala" % "1.2.3-THIB"
val prismic = "io.prismic" %% "scala-kit" % "1.2.11-THIB"
val java8compat = "org.scala-lang.modules" %% "scala-java8-compat" % "0.8.0"