mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-23 01:01:20 +00:00
36 lines
707 B
PHP
36 lines
707 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* @copyright 2021 Ad Aures
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
|
* @link https://castopod.org/
|
|
*/
|
|
|
|
namespace Modules\Analytics;
|
|
|
|
use App\Entities\Episode;
|
|
use CodeIgniter\HTTP\URI;
|
|
|
|
class OP3
|
|
{
|
|
protected string $host;
|
|
|
|
/**
|
|
* @param array<string, string> $config
|
|
*/
|
|
public function __construct(array $config)
|
|
{
|
|
$this->host = rtrim($config['host'], '/');
|
|
}
|
|
|
|
public function wrap(URI $audioURI, Episode $episode): string
|
|
{
|
|
// remove scheme from audioURI
|
|
$audioURI->setScheme('');
|
|
|
|
return $this->host . '/e,pg=' . $episode->podcast->guid . '/' . $audioURI;
|
|
}
|
|
}
|