mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 18:56:42 +02:00
feat(activitypub): add Podcast actor and PodcastEpisode object with comments
This commit is contained in:
parent
b814cfaf7c
commit
9e1e5d2e86
13 changed files with 316 additions and 17 deletions
|
|
@ -12,6 +12,7 @@ namespace App\Models;
|
|||
|
||||
use ActivityPub\Models\StatusModel as ActivityPubStatusModel;
|
||||
use App\Entities\Status;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
|
||||
class StatusModel extends ActivityPubStatusModel
|
||||
{
|
||||
|
|
@ -53,4 +54,21 @@ class StatusModel extends ActivityPubStatusModel
|
|||
->orderBy('published_at', 'DESC')
|
||||
->findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all published statuses for a given episode ordered by publication date
|
||||
*
|
||||
* @return Status[]
|
||||
*/
|
||||
public function getEpisodeComments(int $episodeId): array
|
||||
{
|
||||
return $this->whereIn('in_reply_to_id', function (BaseBuilder $builder) use (&$episodeId): BaseBuilder {
|
||||
return $builder->select('id')
|
||||
->from('activitypub_statuses')
|
||||
->where('episode_id', $episodeId);
|
||||
})
|
||||
->where('`published_at` <= NOW()', null, false)
|
||||
->orderBy('published_at', 'ASC')
|
||||
->findAll();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue