diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-01-21 16:21:05 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-27 15:33:46 +0300 |
commit | 5d5d87f0e04c9722ebe3756c1971edd54e5c6e85 (patch) | |
tree | f19057f9bea2a1d9134b894548cec6c197dc659b /lib | |
parent | 24ccb1d052f4408c5018f66ec0c016cbeee4cdf9 (diff) |
Add config setting to make grid videos limit a hard limit
The hard limit can be enabled with OCC with "occ config:app:set spreed
--value=yes grid_videos_limit_enforced". The changes will take effect
once the user reloads the page
The grid videos limit by default is a fuzzy limit, as the number of
videos shown could be larger due to the available space and aspect ratio
to distribute the videos on. When the limit is made a hard limit the
distributed slots will be the same as before, but only as many videos as
allowed by the limit will be filled in each page.
However, note that with the hard limit the grid may look "broken", as
there is still space to be filled with videos yet they are in the next
page.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Config.php | 4 | ||||
-rw-r--r-- | lib/TInitialState.php | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/Config.php b/lib/Config.php index a036885c7..24555761c 100644 --- a/lib/Config.php +++ b/lib/Config.php @@ -397,4 +397,8 @@ class Config { public function getGridVideosLimit(): string { return $this->config->getAppValue('spreed', 'grid_videos_limit', '0'); } + + public function getGridVideosLimitEnforced(): bool { + return $this->config->getAppValue('spreed', 'grid_videos_limit_enforced', 'no') === 'yes'; + } } diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 0d4c9e446..e7de0ee45 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -77,6 +77,11 @@ trait TInitialState { 'talk', 'grid_videos_limit', $this->talkConfig->getGridVideosLimit() ); + + $this->initialStateService->provideInitialState( + 'talk', 'grid_videos_limit_enforced', + $this->talkConfig->getGridVideosLimitEnforced() + ); } protected function publishInitialStateForUser(IUser $user, IRootFolder $rootFolder, IAppManager $appManager): void { |