Skip to content

Commit

Permalink
TTK-27257: Hide headers and tails in webtv modules (#657)
Browse files Browse the repository at this point in the history
* TTK-27257: Hide headers and tails in webtv modules

* TTK-27257: fix criteria in most viewed of the month
  • Loading branch information
albacodina authored Sep 26, 2024
1 parent a9f93a8 commit e2f91cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Pumukit/StatsBundle/Services/StatsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function doGetMostViewed(array $criteria = [], $days = 30, $limit = 3): a
foreach ($aggregation as $element) {
$ids[] = $element['_id'];
$criteria['_id'] = $element['_id'];
$criteria['head'] = ['$ne' => true];
$criteria['tail'] = ['$ne' => true];
$multimediaObject = $this->repo->findBy($criteria, null, 1);

if ($multimediaObject) {
Expand Down
16 changes: 13 additions & 3 deletions src/Pumukit/WebTVBundle/Controller/ModulesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ public function mostViewedAction(string $design = 'horizontal'): Response
$title = $this->translator->trans('Most viewed on the last month');
} else {
$objects = $this->documentManager->getRepository(MultimediaObject::class)->findStandardBy(
[],
[
'head' => ['$ne' => true],
'tail' => ['$ne' => true],
],
['numview' => -1],
$this->limitObjsMostViewed,
0
Expand Down Expand Up @@ -171,7 +174,11 @@ public function highlightAction(): Response
public function recentlyAddedWithoutHighlightAction(string $design = 'horizontal'): Response
{
$last = $this->documentManager->getRepository(MultimediaObject::class)->findStandardBy(
['tags.cod' => ['$ne' => 'PUDENEW']],
[
'tags.cod' => ['$ne' => 'PUDENEW'],
'head' => ['$ne' => true],
'tail' => ['$ne' => true],
],
[
'public_date' => -1,
],
Expand All @@ -197,7 +204,10 @@ public function recentlyAddedWithoutHighlightAction(string $design = 'horizontal
public function recentlyAddedAllAction(string $design = 'horizontal'): Response
{
$last = $this->documentManager->getRepository(MultimediaObject::class)->findStandardBy(
[],
[
'head' => ['$ne' => true],
'tail' => ['$ne' => true],
],
[
'public_date' => -1,
],
Expand Down

0 comments on commit e2f91cc

Please sign in to comment.