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
@@ -5,6 +5,7 @@
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();

@@ -10,6 +10,7 @@
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();
}

@@ -8,6 +8,7 @@
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

@@ -12,6 +12,7 @@
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

@@ -8,31 +8,49 @@
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