Skip to content

Conversation

@ferishili
Copy link
Contributor

This PR fixes #1321,
The goal is to increase the query performance and decrease the video listing time in workspace and course / playlist.

Introduces:

  • indexes in migration
  • videos count sql optimization
  • video listings cache system

As initial stage, it is considered as a proof of concept and might receive changes afterwards

- indexes in migration
- videos count sql optimization
- video listings cache system
@ferishili ferishili self-assigned this Jun 13, 2025
@ferishili ferishili added type:enhancement v:3 Everything related to the Stud.IP Opencast Plugin Version 3.x status:feedback-required labels Jun 13, 2025
use Opencast\Models\REST\ApiPlaylistsClient;
use Opencast\Helpers\PlaylistMigration;
use Opencast\Errors\Error;
use Opencast\Caching\VideosCaching;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use Opencast\Caching\VideosCaching;

Comment on lines +579 to +580
(new VideosCaching())->playlistVideos($this->id)->expire();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(new VideosCaching())->playlistVideos($this->id)->expire();

use Opencast\Models\REST\ApiWorkflowsClient;
use Opencast\Models\Helpers;
use Opencast\Models\ScheduledRecordings;
use Opencast\Caching\VideosCaching;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use Opencast\Caching\VideosCaching;

Comment on lines +1286 to +1307

/**
* @inheritDoc
*
* Overriding store method, in order to expire caches.
*/
public function store()
{
VideosCaching::expireAllVideoCaches($this);
return parent::store();
}

/**
* @inheritDoc
*
* Overriding delete method, in order to expire caches.
*/
public function delete()
{
VideosCaching::expireAllVideoCaches($this);
return parent::delete();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* @inheritDoc
*
* Overriding store method, in order to expire caches.
*/
public function store()
{
VideosCaching::expireAllVideoCaches($this);
return parent::store();
}
/**
* @inheritDoc
*
* Overriding delete method, in order to expire caches.
*/
public function delete()
{
VideosCaching::expireAllVideoCaches($this);
return parent::delete();
}

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Opencast\OpencastTrait;
use Opencast\OpencastController;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file need to be reverted

use Opencast\OpencastTrait;
use Opencast\OpencastController;
use Opencast\Models\Filter;
use Opencast\Models\Playlists;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file need to be reverted

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Opencast\OpencastTrait;
use Opencast\OpencastController;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file need to be reverted

Comment on lines +109 to +113

public function decodeVars()
{
return base64_encode(json_encode(get_object_vars($this)));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public function decodeVars()
{
return base64_encode(json_encode(get_object_vars($this)));
}

@@ -0,0 +1,137 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file needs to be deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement v:3 Everything related to the Stud.IP Opencast Plugin Version 3.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slow loading of route courses for root

2 participants