diff --git a/app/Config/Embed.php b/app/Config/Embed.php index 0c97f86f..4fda8a86 100644 --- a/app/Config/Embed.php +++ b/app/Config/Embed.php @@ -13,7 +13,7 @@ class Embed extends BaseConfig * Embeddable player config * -------------------------------------------------------------------------- */ - public int $width = 600; + public int $width = 485; - public int $height = 144; + public int $height = 112; } diff --git a/app/Config/Fediverse.php b/app/Config/Fediverse.php index 56c460f0..64494907 100644 --- a/app/Config/Fediverse.php +++ b/app/Config/Fediverse.php @@ -10,10 +10,18 @@ declare(strict_types=1); namespace Config; +use App\Libraries\NoteObject; use Modules\Fediverse\Config\Fediverse as FediverseBaseConfig; class Fediverse extends FediverseBaseConfig { + /** + * -------------------------------------------------------------------- + * ActivityPub Objects + * -------------------------------------------------------------------- + */ + public string $noteObject = NoteObject::class; + public function __construct() { parent::__construct(); diff --git a/app/Controllers/EpisodeController.php b/app/Controllers/EpisodeController.php index 971bfb80..1e8a114d 100644 --- a/app/Controllers/EpisodeController.php +++ b/app/Controllers/EpisodeController.php @@ -205,14 +205,16 @@ class EpisodeController extends BaseController 'html' => '', - 'width' => 600, - 'height' => 144, - 'thumbnail_url' => $this->episode->cover->large_url, + '" width="100%" height="' . config('Embed')->height . '" frameborder="0" scrolling="no">', + 'width' => config('Embed') + ->width, + 'height' => config('Embed') + ->height, + 'thumbnail_url' => $this->episode->cover->og_url, 'thumbnail_width' => config('Images') - ->podcastCoverSizes['large']['width'], + ->podcastCoverSizes['og']['width'], 'thumbnail_height' => config('Images') - ->podcastCoverSizes['large']['height'], + ->podcastCoverSizes['og']['height'], ]); } @@ -227,9 +229,9 @@ class EpisodeController extends BaseController $oembed->addChild('provider_url', $this->podcast->link); $oembed->addChild('author_name', $this->podcast->title); $oembed->addChild('author_url', $this->podcast->link); - $oembed->addChild('thumbnail', $this->episode->cover->large_url); - $oembed->addChild('thumbnail_width', (string) config('Images')->podcastCoverSizes['large']['width']); - $oembed->addChild('thumbnail_height', (string) config('Images')->podcastCoverSizes['large']['height']); + $oembed->addChild('thumbnail', $this->episode->cover->og_url); + $oembed->addChild('thumbnail_width', (string) config('Images')->podcastCoverSizes['og']['width']); + $oembed->addChild('thumbnail_height', (string) config('Images')->podcastCoverSizes['og']['height']); $oembed->addChild( 'html', htmlentities( diff --git a/app/Libraries/NoteObject.php b/app/Libraries/NoteObject.php index 71720ad7..4f27a041 100644 --- a/app/Libraries/NoteObject.php +++ b/app/Libraries/NoteObject.php @@ -24,12 +24,7 @@ class NoteObject extends FediverseNoteObject if ($post->episode_id) { $this->content = - '' . - $post->episode->title . - '
' . - $post->message_html; + '' . $post->episode->title . '
' . $post->message_html; } } } diff --git a/modules/Fediverse/Config/Fediverse.php b/modules/Fediverse/Config/Fediverse.php index 96a12b50..6b052df7 100644 --- a/modules/Fediverse/Config/Fediverse.php +++ b/modules/Fediverse/Config/Fediverse.php @@ -30,11 +30,11 @@ class Fediverse extends BaseConfig * Default avatar and cover images * -------------------------------------------------------------------- */ - public string $defaultAvatarImagePath = 'media/castopod-avatar_fediveration.jpg'; + public string $defaultAvatarImagePath = 'media/avatar-default.jpg'; public string $defaultAvatarImageMimetype = 'image/jpeg'; - public string $defaultCoverImagePath = 'media/castopod-banner-pine_fediveration.jpg'; + public string $defaultCoverImagePath = 'media/banner-default.jpg'; public string $defaultCoverImageMimetype = 'image/jpeg'; diff --git a/modules/Fediverse/Models/PostModel.php b/modules/Fediverse/Models/PostModel.php index dd1a9f4b..9762b24e 100644 --- a/modules/Fediverse/Models/PostModel.php +++ b/modules/Fediverse/Models/PostModel.php @@ -469,11 +469,16 @@ class PostModel extends BaseUuidModel { $this->db->transStart(); + $userId = null; + if (function_exists('user_id')) { + $userId = user_id(); + } + $reblog = new Post([ 'actor_id' => $actor->id, 'reblog_of_id' => $post->id, 'published_at' => Time::now(), - 'created_by' => user_id(), + 'created_by' => $userId, ]); // add reblog diff --git a/themes/cp_app/embed.php b/themes/cp_app/embed.php index 9adf406f..f18a7138 100644 --- a/themes/cp_app/embed.php +++ b/themes/cp_app/embed.php @@ -20,17 +20,17 @@ - <?= $episode->title ?> -
+ <?= $episode->title ?> +
+ ]) ?>">
number, $episode->season_number, 'text-xs font-semibold !no-underline border px-1 border-gray-500', true) ?> - title ?> + title ?>
- -

title ?>

+
+

title ?>