Skip to content

Commit

Permalink
hardcode forum categ ids
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Mar 21, 2021
1 parent 4a99886 commit df9e840
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 0 additions & 6 deletions conf/base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,6 @@ simul {
forum {
topic.max_per_page = 10
post.max_per_page = 10
public_categ_ids = [
general-chess-discussion
game-analysis
lichess-feedback
off-topic-discussion
]
}
forumSearch {
index = forum
Expand Down
3 changes: 1 addition & 2 deletions modules/forum/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import play.api.libs.ws.StandaloneWSClient
@Module
final private class ForumConfig(
@ConfigName("topic.max_per_page") val topicMaxPerPage: MaxPerPage,
@ConfigName("post.max_per_page") val postMaxPerPage: MaxPerPage,
@ConfigName("public_categ_ids") val publicCategIds: List[String]
@ConfigName("post.max_per_page") val postMaxPerPage: MaxPerPage
)

@Module
Expand Down
10 changes: 8 additions & 2 deletions modules/forum/src/main/ForumRecent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ import lila.user.User
final class ForumRecent(
postApi: PostApi,
postRepo: PostRepo,
cacheApi: lila.memo.CacheApi,
categIds: List[String]
cacheApi: lila.memo.CacheApi
)(implicit ec: scala.concurrent.ExecutionContext) {

private val nb: Int = 10

private val categIds = List(
"general-chess-discussion",
"game-analysis",
"lichess-feedback",
"off-topic-discussion"
)

private type GetTeamIds = String => Fu[List[String]]

def apply(user: Option[User], getTeams: GetTeamIds): Fu[List[MiniForumPost]] =
Expand Down

0 comments on commit df9e840

Please sign in to comment.