mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-09-08 19:59:20 +02: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;
|
|
}
|
|
}
|