Meta data (OpenGraph) toegevoegd.
This commit is contained in:
@@ -16,13 +16,14 @@ class Podcast extends Model {
|
||||
public $download;
|
||||
public $duration;
|
||||
public $image;
|
||||
public $metadata;
|
||||
private $key;
|
||||
|
||||
public function __construct($data) {
|
||||
parent::__construct($data);
|
||||
parent::ConvertToDateTime($this->created);
|
||||
|
||||
$this->url = $this->id . '/' . parent::url_slug($this->title);
|
||||
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title);
|
||||
if($this->soundfilename) {
|
||||
// Only generate when not constructing from a JSON object
|
||||
$this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename);
|
||||
@@ -45,6 +46,13 @@ class Podcast extends Model {
|
||||
$imagedata->title = $data->imagecaption;
|
||||
$this->image = new NewsImage($imagedata, '/img/podcast/');
|
||||
}
|
||||
|
||||
$this->metadata = (new MetaData())
|
||||
->set('title', $this->title)
|
||||
->set('description', strip_tags($this->excerpt()))
|
||||
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
|
||||
->set('audio', $this->url)
|
||||
;
|
||||
}
|
||||
|
||||
public function titleWithoutProgram() {
|
||||
|
||||
Reference in New Issue
Block a user