Add .mp3 to podcast URLs

This commit is contained in:
2022-02-28 11:16:24 +01:00
parent 52de4fcaaa
commit f869ee5726
2 changed files with 4 additions and 2 deletions

View File

@@ -46,7 +46,9 @@ class Model {
$text = str_replace($search, $replace, $text); $text = str_replace($search, $replace, $text);
// Verwijder alle woorden van 3 letters, behalve BEL (BEL-combinatie etc) // Verwijder alle woorden van 3 letters, behalve BEL (BEL-combinatie etc)
if(strlen($text) > 3) {
$text = preg_replace('/\b(?!bel|fm|nh)([a-z]{1,3})\b/u', '', $text); $text = preg_replace('/\b(?!bel|fm|nh)([a-z]{1,3})\b/u', '', $text);
}
// Vervang alles dat niet een woord-karakter is (letter, cijfer), een streepje of spatie // Vervang alles dat niet een woord-karakter is (letter, cijfer), een streepje of spatie
$text = preg_replace('/[^\w_\-\s]/', '', $text); $text = preg_replace('/[^\w_\-\s]/', '', $text);

View File

@@ -23,7 +23,7 @@ class Podcast extends Model {
parent::__construct($data); parent::__construct($data);
parent::ConvertToDateTime($this->created); parent::ConvertToDateTime($this->created);
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title); $this->url = '/' . $this->id . '/' . parent::url_slug($this->title) . '.mp3';
if($this->soundfilename) { if($this->soundfilename) {
// Only generate when not constructing from a JSON object // Only generate when not constructing from a JSON object
$this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename); $this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename);