mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-15 04:27:46 +02:00
feat(episodes): replace all audio file URL parameters with base64 encoded data
This commit is contained in:
parent
391c349daa
commit
e1f65cd3b5
5 changed files with 71 additions and 41 deletions
|
|
@ -46,24 +46,24 @@ class Analytics extends Controller
|
|||
}
|
||||
|
||||
// Add one hit to this episode:
|
||||
public function hit(
|
||||
$podcastId,
|
||||
$episodeId,
|
||||
$bytesThreshold,
|
||||
$fileSize,
|
||||
$duration,
|
||||
...$filename
|
||||
) {
|
||||
helper('media');
|
||||
public function hit($base64EpisodeData, ...$filename)
|
||||
{
|
||||
helper('media', 'analytics');
|
||||
|
||||
$serviceName = isset($_GET['_from']) ? $_GET['_from'] : '';
|
||||
|
||||
$episodeData = unpack(
|
||||
'IpodcastId/IepisodeId/IbytesThreshold/IfileSize/Iduration/IpublicationDate',
|
||||
base64_url_decode($base64EpisodeData)
|
||||
);
|
||||
|
||||
podcast_hit(
|
||||
$podcastId,
|
||||
$episodeId,
|
||||
$bytesThreshold,
|
||||
$fileSize,
|
||||
$duration,
|
||||
$episodeData['podcastId'],
|
||||
$episodeData['episodeId'],
|
||||
$episodeData['bytesThreshold'],
|
||||
$episodeData['fileSize'],
|
||||
$episodeData['duration'],
|
||||
$episodeData['publicationDate'],
|
||||
$serviceName
|
||||
);
|
||||
return redirect()->to(media_base_url($filename));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue