diff --git a/app/Config/Embed.php b/app/Config/Embed.php index 0c97f86f08b57e7a2286662641a7c30ea77dff7d..4fda8a86364f56948e728109bdbb2d274d329353 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 56c460f07aad89f2af8be20d9876465d814095c6..64494907f450679df13a4ae087352d5889e49439 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 971bfb80f142c738996743103948cc09fdcc6030..1e8a114d74d9a1faa32f303b01254a2426026cb2 100644 --- a/app/Controllers/EpisodeController.php +++ b/app/Controllers/EpisodeController.php @@ -205,14 +205,16 @@ class EpisodeController extends BaseController 'html' => '<iframe src="' . $this->episode->embed_url . - '" width="100%" height="144" frameborder="0" scrolling="no"></iframe>', - 'width' => 600, - 'height' => 144, - 'thumbnail_url' => $this->episode->cover->large_url, + '" width="100%" height="' . config('Embed')->height . '" frameborder="0" scrolling="no"></iframe>', + '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 71720ad74783f31eacb2b2d98d1c02352185e935..4f27a0416f9b902cd97a896094fe3b5ee2084275 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 = - '<a href="' . - $post->episode->link . - '" target="_blank" rel="noopener noreferrer">' . - $post->episode->title . - '</a><br/>' . - $post->message_html; + '<a href="' . $post->episode->link . '">' . $post->episode->title . '</a><br/>' . $post->message_html; } } } diff --git a/modules/Fediverse/Config/Fediverse.php b/modules/Fediverse/Config/Fediverse.php index 96a12b5063e64204303d9629614570698bd1133e..6b052df7d15ad9306bdc3504666e17141dc1810f 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 dd1a9f4b998be5b334482ffd87ede11b904d9af5..9762b24ebc93fe9e27ddc84e55ef40216faedc5f 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 9adf406f9fe3e67698e1642842e1b5d38ce41ae8..f18a7138e87281f7a35d63e198f10c30aa7c4629 100644 --- a/themes/cp_app/embed.php +++ b/themes/cp_app/embed.php @@ -20,17 +20,17 @@ </head> <body class="flex" style="background: <?= $themeData['background'] ?>; color: <?= $themeData['text'] ?>;"> - <img src="<?= $episode->cover->thumbnail_url ?>" alt="<?= $episode->title ?>" class="flex-shrink w-36 h-36 aspect-square" loading="lazy" /> - <div class="flex flex-col items-start flex-1 min-w-0 px-4 pt-4 h-36"> + <img src="<?= $episode->cover->thumbnail_url ?>" alt="<?= $episode->title ?>" class="flex-shrink w-28 h-28 aspect-square" loading="lazy" /> + <div class="flex flex-col items-start flex-1 min-w-0 px-4 pt-4 h-28"> <a href="https://castopod.org/" class="absolute top-0 right-0 mt-1 mr-2 text-2xl text-pine-500 hover:opacity-75" title="<?= lang('Common.powered_by', [ 'castopod' => 'Castopod', - ]) ?>" target="_blank" rel="noopener noreferrer"><?= icon('podcasting/castopod') ?></a> + ]) ?>"><?= icon('podcasting/castopod') ?></a> <div class="flex gap-x-2"> <?= episode_numbering($episode->number, $episode->season_number, 'text-xs font-semibold !no-underline border px-1 border-gray-500', true) ?> - <a href="<?= route_to('podcast-activity', $podcast->handle) ?>" style="color: <?= $themeData['text'] ?>;" class="text-xs truncate opacity-75 hover:opacity-100" target="_blank"><?= $podcast->title ?></a> + <a href="<?= route_to('podcast-activity', $podcast->handle) ?>" style="color: <?= $themeData['text'] ?>;" class="text-xs truncate opacity-75 hover:opacity-100"><?= $podcast->title ?></a> </div> - <a href="<?= $episode->link ?>" class="flex flex-col items-start text-sm" style="color: <?= $themeData['text'] ?>;" target="_blank"> - <h1 class="text-lg font-semibold leading-tight opacity-100 line-clamp-2 hover:opacity-75"><?= $episode->title ?></h1> + <a href="<?= $episode->link ?>" class="flex flex-col items-start text-sm" style="color: <?= $themeData['text'] ?>;"> + <h1 class="font-semibold leading-tight opacity-100 line-clamp-2 hover:opacity-75"><?= $episode->title ?></h1> </a> <vm-player id="castopod-vm-player"