refactor: clean episode analytics url by removing podcasts/ prefix

This commit is contained in:
Yassine Doghri 2021-06-11 08:53:14 +00:00
parent 3a7d97d660
commit 8d9bba4e9f
No known key found for this signature in database
GPG Key ID: 3E7F89498B960C9F
2 changed files with 5 additions and 2 deletions

View File

@ -296,10 +296,13 @@ class Episode extends Entity
{ {
helper('analytics'); helper('analytics');
// remove 'podcasts/' from audio file path
$strippedAudioFilePath = substr($this->audio_file_path, 9);
return generate_episode_analytics_url( return generate_episode_analytics_url(
$this->podcast_id, $this->podcast_id,
$this->id, $this->id,
$this->audio_file_path, $strippedAudioFilePath,
$this->audio_file_duration, $this->audio_file_duration,
$this->audio_file_size, $this->audio_file_size,
$this->audio_file_header_size, $this->audio_file_header_size,

View File

@ -77,6 +77,6 @@ class EpisodeAnalyticsController extends Controller
$serviceName, $serviceName,
); );
return redirect()->to($this->config->getAudioFileUrl($audioFilePath)); return redirect()->to($this->config->getAudioFileUrl(['podcasts', ...$audioFilePath]));
} }
} }