live settings to feature tournaments of a team
This commit is contained in:
parent
1aec43b930
commit
1b66b22f7b
|
@ -106,6 +106,11 @@ final class Env(
|
|||
text =
|
||||
"Secret tokens that allows fetching ongoing games without the 3-moves delay. Separated by commas.".some
|
||||
)
|
||||
lazy val featuredTeamsSetting = memo.settingStore[Strings](
|
||||
"featuredTeams",
|
||||
default = Strings(Nil),
|
||||
text = "Team IDs that always get their tournaments visible on /tournament".some
|
||||
)
|
||||
|
||||
lazy val preloader = wire[mashup.Preload]
|
||||
lazy val socialInfo = wire[mashup.UserInfo.SocialApi]
|
||||
|
|
|
@ -19,7 +19,8 @@ final class Dev(env: Env) extends LilaController(env) {
|
|||
env.rating.ratingFactorsSetting,
|
||||
env.plan.donationGoalSetting,
|
||||
env.apiTimelineSetting,
|
||||
env.noDelaySecretSetting
|
||||
env.noDelaySecretSetting,
|
||||
env.featuredTeamsSetting
|
||||
)
|
||||
|
||||
def settings =
|
||||
|
|
|
@ -45,8 +45,9 @@ final class Tournament(
|
|||
finished <- api.notableFinished
|
||||
winners <- env.tournament.winners.all
|
||||
teamIds <- ctx.userId.??(env.team.cached.teamIdsList)
|
||||
teamVisible <- repo.visibleForTeams(teamIds, 5 * 60)
|
||||
scheduleJson <- env.tournament.apiJsonView(visible add teamVisible)
|
||||
allTeamIds = (env.featuredTeamsSetting.get().value ++ teamIds).distinct
|
||||
teamVisible <- repo.visibleForTeams(allTeamIds, 5 * 60)
|
||||
scheduleJson <- env.tournament.apiJsonView(visible add teamVisible)
|
||||
} yield NoCache {
|
||||
pageHit
|
||||
Ok(html.tournament.home(scheduled, finished, winners, scheduleJson))
|
||||
|
|
Loading…
Reference in a new issue