mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-08-20 08:03:22 +02:00
59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* @copyright 2022 Ad Aures
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace Config;
|
|
|
|
use App\Libraries\NoteObject;
|
|
use Exception;
|
|
use Modules\Fediverse\Config\Fediverse as FediverseBaseConfig;
|
|
|
|
class Fediverse extends FediverseBaseConfig
|
|
{
|
|
/**
|
|
* --------------------------------------------------------------------
|
|
* ActivityPub Objects
|
|
* --------------------------------------------------------------------
|
|
*/
|
|
public string $noteObject = NoteObject::class;
|
|
|
|
public string $defaultAvatarImagePath = 'castopod-avatar_thumbnail.webp';
|
|
|
|
public string $defaultAvatarImageMimetype = 'image/webp';
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
try {
|
|
$appTheme = service('settings')
|
|
->get('App.theme');
|
|
$defaultBanner = config(Images::class)
|
|
->podcastBannerDefaultPaths[$appTheme] ?? config(Images::class)->podcastBannerDefaultPaths['default'];
|
|
} catch (Exception) {
|
|
$defaultBanner = config(Images::class)
|
|
->podcastBannerDefaultPaths['default'];
|
|
}
|
|
|
|
['dirname' => $dirname, 'extension' => $extension, 'filename' => $filename] = pathinfo(
|
|
$defaultBanner['path']
|
|
);
|
|
$defaultBannerPath = $filename;
|
|
if ($dirname !== '.') {
|
|
$defaultBannerPathList = [$dirname, $filename];
|
|
$defaultBannerPath = implode('/', $defaultBannerPathList);
|
|
}
|
|
|
|
helper('media');
|
|
|
|
$this->defaultCoverImagePath = $defaultBannerPath . '_federation.' . $extension;
|
|
$this->defaultCoverImageMimetype = $defaultBanner['mimetype'];
|
|
}
|
|
}
|