chore: update CI to v4.6.3 + all php and js dependencies

This commit is contained in:
Yassine Doghri 2025-08-25 18:09:41 +00:00
commit 346c00e7b5
206 changed files with 6239 additions and 5336 deletions

View file

@ -162,15 +162,11 @@ class ClipModel extends Model
return (int) $result[0]['id'];
}
public function deleteVideoClip(int $podcastId, int $episodeId, int $clipId): BaseResult | bool
public function deleteVideoClip(int $clipId): BaseResult | bool
{
$this->clearVideoClipCache($clipId);
return $this->delete([
'podcast_id' => $podcastId,
'episode_id' => $episodeId,
'id' => $clipId,
]);
return $this->delete($clipId);
}
public function getClipCount(int $podcastId, int $episodeId): int
@ -240,11 +236,7 @@ class ClipModel extends Model
{
$this->clearSoundbiteCache($podcastId, $episodeId, $clipId);
return $this->delete([
'podcast_id' => $podcastId,
'episode_id' => $episodeId,
'id' => $clipId,
]);
return $this->delete($clipId);
}
public function clearSoundbiteCache(int $podcastId, int $episodeId, int $clipId): void

View file

@ -86,11 +86,13 @@ class EpisodeCommentModel extends UuidModel
}
if ($comment->in_reply_to_id === null) {
(new EpisodeModel())->builder()
new EpisodeModel()
->builder()
->where('id', $comment->episode_id)
->increment('comments_count');
} else {
(new self())->builder()
new self()
->builder()
->where('id', service('uuid')->fromString($comment->in_reply_to_id)->getBytes())
->increment('replies_count');
}
@ -180,7 +182,8 @@ class EpisodeCommentModel extends UuidModel
->where('id', $comment->episode_id)
->decrement('comments_count');
} else {
(new self())->builder()
new self()
->builder()
->where('id', service('uuid')->fromString($comment->in_reply_to_id)->getBytes())
->decrement('replies_count');
}

View file

@ -368,13 +368,15 @@ class EpisodeModel extends UuidModel
public function resetCommentsCount(): int | false
{
$episodeCommentsCount = (new EpisodeCommentModel())->builder()
$episodeCommentsCount = new EpisodeCommentModel()
->builder()
->select('episode_id, COUNT(*) as `comments_count`')
->where('in_reply_to_id', null)
->groupBy('episode_id')
->getCompiledSelect();
$episodePostsRepliesCount = (new PostModel())->builder()
$episodePostsRepliesCount = new PostModel()
->builder()
->select('fediverse_posts.episode_id as episode_id, COUNT(*) as `comments_count`')
->join('fediverse_posts as fp', 'fediverse_posts.id = fp.in_reply_to_id')
->where('fediverse_posts.in_reply_to_id', null)
@ -390,7 +392,8 @@ class EpisodeModel extends UuidModel
$countsPerEpisodeId = $query->getResultArray();
if ($countsPerEpisodeId !== []) {
return (new self())->updateBatch($countsPerEpisodeId, 'id');
return new self()
->updateBatch($countsPerEpisodeId, 'id');
}
return 0;
@ -429,7 +432,8 @@ class EpisodeModel extends UuidModel
}
/** @var ?Episode $episode */
$episode = (new self())->find($episodeId);
$episode = new self()
->find($episodeId);
if (! $episode instanceof Episode) {
return $data;
@ -523,7 +527,8 @@ class EpisodeModel extends UuidModel
}
/** @var ?Episode $episode */
$episode = (new self())->find($episodeId);
$episode = new self()
->find($episodeId);
if (! $episode instanceof Episode) {
return $data;

View file

@ -56,7 +56,8 @@ class LikeModel extends UuidModel
'comment_id' => $comment->id,
]);
(new EpisodeCommentModel())->builder()
new EpisodeCommentModel()
->builder()
->where('id', service('uuid')->fromString($comment->id)->getBytes())
->increment('likes_count');
@ -91,7 +92,8 @@ class LikeModel extends UuidModel
{
$this->db->transStart();
(new EpisodeCommentModel())->builder()
new EpisodeCommentModel()
->builder()
->where('id', service('uuid') ->fromString($comment->id) ->getBytes())
->decrement('likes_count');

View file

@ -297,9 +297,10 @@ class PersonModel extends Model
cache()
->delete("podcast#{$podcastId}_persons");
(new PodcastModel())->clearCache([
'id' => $podcastId,
]);
new PodcastModel()
->clearCache([
'id' => $podcastId,
]);
$data = [];
foreach ($personIds as $personId) {
@ -339,9 +340,10 @@ class PersonModel extends Model
cache()->deleteMatching("podcast#{$podcastId}_person#{$personId}*");
cache()
->delete("podcast#{$podcastId}_persons");
(new PodcastModel())->clearCache([
'id' => $podcastId,
]);
new PodcastModel()
->clearCache([
'id' => $podcastId,
]);
return $this->db->table('podcasts_persons')
->delete([
@ -363,9 +365,10 @@ class PersonModel extends Model
if ($personIds !== []) {
cache()
->delete("podcast#{$podcastId}_episode#{$episodeId}_persons");
(new EpisodeModel())->clearCache([
'id' => $episodeId,
]);
new EpisodeModel()
->clearCache([
'id' => $episodeId,
]);
$data = [];
foreach ($personIds as $personId) {
@ -404,9 +407,10 @@ class PersonModel extends Model
cache()->deleteMatching("podcast#{$podcastId}_episode#{$episodeId}_person#{$personId}*");
cache()
->delete("podcast#{$podcastId}_episode#{$episodeId}_persons");
(new EpisodeModel())->clearCache([
'id' => $episodeId,
]);
new EpisodeModel()
->clearCache([
'id' => $episodeId,
]);
return $this->db->table('episodes_persons')
->delete([

View file

@ -309,7 +309,8 @@ class PodcastModel extends Model
];
}
$secondsToNextUnpublishedEpisode = (new EpisodeModel())->getSecondsToNextUnpublishedEpisode($podcastId);
$secondsToNextUnpublishedEpisode = new EpisodeModel()
->getSecondsToNextUnpublishedEpisode($podcastId);
cache()
->save($cacheName, $defaultQuery, $secondsToNextUnpublishedEpisode ?: DECADE);
@ -325,7 +326,8 @@ class PodcastModel extends Model
*/
public function clearCache(array $data): array
{
$podcast = (new self())->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
$podcast = new self()
->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
// delete cache for users' podcasts
cache()
@ -389,21 +391,22 @@ class PodcastModel extends Model
$domain =
$url->getHost() . ($url->getPort() ? ':' . $url->getPort() : '');
$actorId = (new ActorModel())->insert(
[
'uri' => url_to('podcast-activity', $username),
'username' => $username,
'domain' => $domain,
'private_key' => $privatekey,
'public_key' => $publickey,
'display_name' => $data['data']['title'],
'summary' => $data['data']['description_html'],
'inbox_url' => url_to('inbox', $username),
'outbox_url' => url_to('outbox', $username),
'followers_url' => url_to('followers', $username),
],
true,
);
$actorId = new ActorModel()
->insert(
[
'uri' => url_to('podcast-activity', $username),
'username' => $username,
'domain' => $domain,
'private_key' => $privatekey,
'public_key' => $publickey,
'display_name' => $data['data']['title'],
'summary' => $data['data']['description_html'],
'inbox_url' => url_to('inbox', $username),
'outbox_url' => url_to('outbox', $username),
'followers_url' => url_to('followers', $username),
],
true,
);
$data['data']['actor_id'] = $actorId;
@ -417,10 +420,12 @@ class PodcastModel extends Model
*/
protected function setActorAvatar(array $data): array
{
$podcast = (new self())->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
$podcast = new self()
->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
if ($podcast instanceof Podcast) {
$podcastActor = (new ActorModel())->find($podcast->actor_id);
$podcastActor = new ActorModel()
->find($podcast->actor_id);
if (! $podcastActor instanceof Actor) {
return $data;
@ -429,7 +434,8 @@ class PodcastModel extends Model
$podcastActor->avatar_image_url = $podcast->cover->federation_url;
$podcastActor->avatar_image_mimetype = $podcast->cover->federation_mimetype;
(new ActorModel())->update($podcast->actor_id, $podcastActor);
new ActorModel()
->update($podcast->actor_id, $podcastActor);
}
return $data;
@ -442,7 +448,8 @@ class PodcastModel extends Model
*/
protected function updatePodcastActor(array $data): array
{
$podcast = (new self())->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
$podcast = new self()
->find((int) (is_array($data['id']) ? $data['id'][0] : $data['id']));
if ($podcast instanceof Podcast) {
$actorModel = new ActorModel();