package reading.models case class Book( title: String, author: String, year: String, parts: Int = 1, period: Option[Period], genres: Seq[Genre], themes: Seq[Theme], programs: Seq[Program], level: Level, summary: String ) extends Ordered[Book] { def compare(that: Book) = Compare.format(this.title).compare(Compare.format(that.title)) } object Book { def filter(books: Seq[Book], search: String = ""): Seq[Book] = books.filter { book => (Search(book.title, search) || Search(book.author, search)) } }