Merge branch 'master' into analysis
* master: update todo Revert "upgrade casbah and salat, fix deprecations" Revert "upgrade casbah" Conflicts: todo
This commit is contained in:
commit
d952c82073
|
@ -61,7 +61,7 @@ final class BookmarkRepo(val collection: MongoCollection) {
|
||||||
"g" -> gameId,
|
"g" -> gameId,
|
||||||
"u" -> userId,
|
"u" -> userId,
|
||||||
"d" -> date),
|
"d" -> date),
|
||||||
concern = WriteConcern.Safe
|
writeConcern = WriteConcern.Safe
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import game.GameRepo
|
||||||
import round.Finisher
|
import round.Finisher
|
||||||
import bookmark.BookmarkApi
|
import bookmark.BookmarkApi
|
||||||
|
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import org.scala_tools.time.Imports._
|
import org.scala_tools.time.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
|
@ -12,7 +12,7 @@ final class CategRepo(
|
||||||
) extends SalatDAO[Categ, String](collection) {
|
) extends SalatDAO[Categ, String](collection) {
|
||||||
|
|
||||||
def bySlug(slug: String): IO[Option[Categ]] = io {
|
def bySlug(slug: String): IO[Option[Categ]] = io {
|
||||||
findOneById(slug)
|
findOneByID(slug)
|
||||||
}
|
}
|
||||||
|
|
||||||
val all: IO[List[Categ]] = io {
|
val all: IO[List[Categ]] = io {
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class PostRepo(
|
||||||
collection: MongoCollection) extends SalatDAO[Post, String](collection) {
|
collection: MongoCollection) extends SalatDAO[Post, String](collection) {
|
||||||
|
|
||||||
def byId(id: String): IO[Option[Post]] = io {
|
def byId(id: String): IO[Option[Post]] = io {
|
||||||
findOneById(id)
|
findOneByID(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
def countByTopics(topics: List[Topic]): IO[Int] = io {
|
def countByTopics(topics: List[Topic]): IO[Int] = io {
|
||||||
|
|
|
@ -4,14 +4,14 @@ package forum
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
||||||
final class TopicRepo(
|
final class TopicRepo(
|
||||||
collection: MongoCollection) extends SalatDAO[Topic, String](collection) {
|
collection: MongoCollection) extends SalatDAO[Topic, String](collection) {
|
||||||
|
|
||||||
def byId(id: String): IO[Option[Topic]] = io {
|
def byId(id: String): IO[Option[Topic]] = io {
|
||||||
findOneById(id)
|
findOneByID(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
def byCateg(categ: Categ): IO[List[Topic]] = io {
|
def byCateg(categ: Categ): IO[List[Topic]] = io {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import user.User
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import org.scala_tools.time.Imports._
|
import org.scala_tools.time.Imports._
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
@ -23,7 +23,7 @@ class GameRepo(collection: MongoCollection)
|
||||||
|
|
||||||
def game(gameId: String): IO[Option[DbGame]] = io {
|
def game(gameId: String): IO[Option[DbGame]] = io {
|
||||||
if (gameId.size != gameIdSize) None
|
if (gameId.size != gameIdSize) None
|
||||||
else findOneById(gameId) flatMap (_.decode)
|
else findOneByID(gameId) flatMap (_.decode)
|
||||||
}
|
}
|
||||||
|
|
||||||
def player(gameId: String, color: Color): IO[Option[DbPlayer]] =
|
def player(gameId: String, color: Color): IO[Option[DbPlayer]] =
|
||||||
|
|
|
@ -6,7 +6,7 @@ import game.DbGame
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import org.scala_tools.time.Imports._
|
import org.scala_tools.time.Imports._
|
||||||
|
@ -15,7 +15,7 @@ class HookRepo(collection: MongoCollection)
|
||||||
extends SalatDAO[Hook, String](collection) {
|
extends SalatDAO[Hook, String](collection) {
|
||||||
|
|
||||||
def hook(hookId: String): IO[Option[Hook]] = io {
|
def hook(hookId: String): IO[Option[Hook]] = io {
|
||||||
findOneById(hookId)
|
findOneByID(hookId)
|
||||||
}
|
}
|
||||||
|
|
||||||
def ownedHook(ownerId: String): IO[Option[Hook]] = io {
|
def ownedHook(ownerId: String): IO[Option[Hook]] = io {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package lobby
|
||||||
|
|
||||||
import mongodb.CappedRepo
|
import mongodb.CappedRepo
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
||||||
final class MessageRepo(collection: MongoCollection, max: Int)
|
final class MessageRepo(collection: MongoCollection, max: Int)
|
||||||
|
|
|
@ -6,15 +6,14 @@ import user.User
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import com.mongodb.casbah.map_reduce.MapReduceInlineOutput
|
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
||||||
final class ThreadRepo(
|
final class ThreadRepo(
|
||||||
collection: MongoCollection) extends SalatDAO[Thread, String](collection) {
|
collection: MongoCollection) extends SalatDAO[Thread, String](collection) {
|
||||||
|
|
||||||
def byId(id: String): IO[Option[Thread]] = io {
|
def byId(id: String): IO[Option[Thread]] = io {
|
||||||
findOneById(id)
|
findOneByID(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
def byUser(user: User): IO[List[Thread]] = io {
|
def byUser(user: User): IO[List[Thread]] = io {
|
||||||
|
|
|
@ -4,14 +4,14 @@ package round
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
||||||
class RoomRepo(collection: MongoCollection)
|
class RoomRepo(collection: MongoCollection)
|
||||||
extends SalatDAO[Room, String](collection) {
|
extends SalatDAO[Room, String](collection) {
|
||||||
|
|
||||||
def room(id: String): IO[Room] = io {
|
def room(id: String): IO[Room] = io {
|
||||||
findOneById(id) | Room(id, Nil)
|
findOneByID(id) | Room(id, Nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
def addMessage(id: String, author: String, message: String): IO[Unit] = io {
|
def addMessage(id: String, author: String, message: String): IO[Unit] = io {
|
||||||
|
|
|
@ -4,7 +4,7 @@ package round
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
||||||
class WatcherRoomRepo(collection: MongoCollection)
|
class WatcherRoomRepo(collection: MongoCollection)
|
||||||
|
@ -13,7 +13,7 @@ class WatcherRoomRepo(collection: MongoCollection)
|
||||||
import WatcherRoom.Message
|
import WatcherRoom.Message
|
||||||
|
|
||||||
def room(id: String): IO[WatcherRoom] = io {
|
def room(id: String): IO[WatcherRoom] = io {
|
||||||
findOneById(id) | WatcherRoom(id, Nil)
|
findOneByID(id) | WatcherRoom(id, Nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
def addMessage(id: String, username: Option[String], text: String): IO[Message] = io {
|
def addMessage(id: String, username: Option[String], text: String): IO[Message] = io {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import user.User
|
||||||
|
|
||||||
import play.api.mvc.RequestHeader
|
import play.api.mvc.RequestHeader
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class UserConfigRepo(collection: MongoCollection)
|
||||||
} yield ()
|
} yield ()
|
||||||
|
|
||||||
def config(user: User): IO[UserConfig] = io {
|
def config(user: User): IO[UserConfig] = io {
|
||||||
findOneById(user.id) flatMap (_.decode)
|
findOneByID(user.id) flatMap (_.decode)
|
||||||
} except { e ⇒
|
} except { e ⇒
|
||||||
putStrLn("Can't load config: " + e.getMessage) map (_ ⇒ none[UserConfig])
|
putStrLn("Can't load config: " + e.getMessage) map (_ ⇒ none[UserConfig])
|
||||||
} map (_ | UserConfig.default(user))
|
} map (_ | UserConfig.default(user))
|
||||||
|
|
|
@ -2,7 +2,7 @@ package lila
|
||||||
package user
|
package user
|
||||||
|
|
||||||
import com.mongodb.casbah.MongoCollection
|
import com.mongodb.casbah.MongoCollection
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
|
|
||||||
import java.lang.Float.parseFloat
|
import java.lang.Float.parseFloat
|
||||||
import java.lang.Integer.parseInt
|
import java.lang.Integer.parseInt
|
||||||
|
|
|
@ -4,14 +4,14 @@ package user
|
||||||
import com.novus.salat._
|
import com.novus.salat._
|
||||||
import com.novus.salat.dao._
|
import com.novus.salat.dao._
|
||||||
import com.mongodb.casbah.{ MongoCollection, WriteConcern }
|
import com.mongodb.casbah.{ MongoCollection, WriteConcern }
|
||||||
import com.mongodb.casbah.query.Imports._
|
import com.mongodb.casbah.Imports._
|
||||||
import scalaz.effects._
|
import scalaz.effects._
|
||||||
import com.roundeights.hasher.Implicits._
|
import com.roundeights.hasher.Implicits._
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import ornicar.scalalib.OrnicarRandom
|
import ornicar.scalalib.OrnicarRandom
|
||||||
|
|
||||||
class UserRepo(collection: MongoCollection)
|
class UserRepo(
|
||||||
extends SalatDAO[User, String](collection) {
|
collection: MongoCollection) extends SalatDAO[User, String](collection) {
|
||||||
|
|
||||||
val enabledQuery = DBObject("enabled" -> true)
|
val enabledQuery = DBObject("enabled" -> true)
|
||||||
def byIdQuery(id: String): DBObject = DBObject("_id" -> normalize(id))
|
def byIdQuery(id: String): DBObject = DBObject("_id" -> normalize(id))
|
||||||
|
@ -20,7 +20,7 @@ extends SalatDAO[User, String](collection) {
|
||||||
def normalize(id: String) = id.toLowerCase
|
def normalize(id: String) = id.toLowerCase
|
||||||
|
|
||||||
def byId(id: String): IO[Option[User]] = io {
|
def byId(id: String): IO[Option[User]] = io {
|
||||||
findOneById(normalize(id))
|
findOneByID(normalize(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
def byIds(ids: Iterable[String]): IO[List[User]] = io {
|
def byIds(ids: Iterable[String]): IO[List[User]] = io {
|
||||||
|
|
|
@ -11,7 +11,7 @@ final class PageRepo(
|
||||||
collection: MongoCollection) extends SalatDAO[Page, String](collection) {
|
collection: MongoCollection) extends SalatDAO[Page, String](collection) {
|
||||||
|
|
||||||
def byId(id: String): IO[Option[Page]] = io {
|
def byId(id: String): IO[Option[Page]] = io {
|
||||||
findOneById(id)
|
findOneByID(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
val all: IO[List[Page]] = io {
|
val all: IO[List[Page]] = io {
|
||||||
|
|
|
@ -7,7 +7,6 @@ trait Resolvers {
|
||||||
val typesafe = "typesafe.com" at "http://repo.typesafe.com/typesafe/releases/"
|
val typesafe = "typesafe.com" at "http://repo.typesafe.com/typesafe/releases/"
|
||||||
val iliaz = "iliaz.com" at "http://scala.iliaz.com/"
|
val iliaz = "iliaz.com" at "http://scala.iliaz.com/"
|
||||||
val sonatype = "sonatype" at "http://oss.sonatype.org/content/repositories/releases"
|
val sonatype = "sonatype" at "http://oss.sonatype.org/content/repositories/releases"
|
||||||
val sonatypeS = "sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots"
|
|
||||||
val t2v = "t2v.jp repo" at "http://www.t2v.jp/maven-repo/"
|
val t2v = "t2v.jp repo" at "http://www.t2v.jp/maven-repo/"
|
||||||
val guice = "guice-maven" at "http://guice-maven.googlecode.com/svn/trunk"
|
val guice = "guice-maven" at "http://guice-maven.googlecode.com/svn/trunk"
|
||||||
val jgitMaven = "jgit-maven" at "http://download.eclipse.org/jgit/maven"
|
val jgitMaven = "jgit-maven" at "http://download.eclipse.org/jgit/maven"
|
||||||
|
@ -17,8 +16,8 @@ trait Dependencies {
|
||||||
val scalachess = "com.github.ornicar" %% "scalachess" % "2.1"
|
val scalachess = "com.github.ornicar" %% "scalachess" % "2.1"
|
||||||
val scalaz = "org.scalaz" %% "scalaz-core" % "6.0.4"
|
val scalaz = "org.scalaz" %% "scalaz-core" % "6.0.4"
|
||||||
val specs2 = "org.specs2" %% "specs2" % "1.11"
|
val specs2 = "org.specs2" %% "specs2" % "1.11"
|
||||||
val casbah = "org.mongodb" %% "casbah" % "2.4.0"
|
val casbah = "com.mongodb.casbah" %% "casbah" % "2.1.5-1"
|
||||||
val salat = "com.novus" %% "salat-core" % "1.9-SNAPSHOT"
|
val salat = "com.novus" %% "salat-core" % "0.0.8-SNAPSHOT"
|
||||||
val scalalib = "com.github.ornicar" %% "scalalib" % "1.37"
|
val scalalib = "com.github.ornicar" %% "scalalib" % "1.37"
|
||||||
val config = "com.typesafe" % "config" % "0.4.0"
|
val config = "com.typesafe" % "config" % "0.4.0"
|
||||||
val json = "com.codahale" %% "jerkson" % "0.5.0"
|
val json = "com.codahale" %% "jerkson" % "0.5.0"
|
||||||
|
@ -38,9 +37,9 @@ object ApplicationBuild extends Build with Resolvers with Dependencies {
|
||||||
|
|
||||||
private val buildSettings = Project.defaultSettings ++ Seq(
|
private val buildSettings = Project.defaultSettings ++ Seq(
|
||||||
organization := "com.github.ornicar",
|
organization := "com.github.ornicar",
|
||||||
version := "1.0",
|
version := "0.1",
|
||||||
scalaVersion := "2.9.1",
|
scalaVersion := "2.9.1",
|
||||||
resolvers := Seq(iliaz, codahale, sonatype, sonatypeS, typesafe, t2v, guice, jgitMaven),
|
resolvers := Seq(iliaz, codahale, sonatype, typesafe, t2v, guice, jgitMaven),
|
||||||
libraryDependencies := Seq(scalaz, scalalib, hasher),
|
libraryDependencies := Seq(scalaz, scalalib, hasher),
|
||||||
libraryDependencies in test := Seq(specs2),
|
libraryDependencies in test := Seq(specs2),
|
||||||
shellPrompt := {
|
shellPrompt := {
|
||||||
|
|
1
todo
1
todo
|
@ -29,3 +29,4 @@ analysis: replace scores with bar (adv+delta visible)
|
||||||
legend feedback: http://en.lichess.org/forum/lichess-feedback/a-few-points-bugssuggestions#1
|
legend feedback: http://en.lichess.org/forum/lichess-feedback/a-few-points-bugssuggestions#1
|
||||||
http://en.lichess.org/forum/lichess-feedback/problems-with-yin-yang#1
|
http://en.lichess.org/forum/lichess-feedback/problems-with-yin-yang#1
|
||||||
also translate websockets error message
|
also translate websockets error message
|
||||||
|
play with a friend possible bug http://en.lichess.org/forum/lichess-feedback/play-with-a-friend-bug
|
||||||
|
|
Loading…
Reference in a new issue