Podcasts
This commit is contained in:
@@ -12,6 +12,7 @@ class Podcast extends Model {
|
||||
public $created;
|
||||
public $program;
|
||||
public $url;
|
||||
public $auth;
|
||||
public $download;
|
||||
private $key;
|
||||
|
||||
@@ -19,11 +20,19 @@ class Podcast extends Model {
|
||||
parent::__construct($data);
|
||||
parent::ConvertToDateTime($this->created);
|
||||
|
||||
$this->key = sha1($this->id . ':' . session_id() . ':' . $this->soundfilename);
|
||||
$this->url = $this->id . '/' . parent::url_slug($this->title) . '?auth=' . $this->key;
|
||||
|
||||
if($this->program != 0) {
|
||||
$this->program = new \Model\Program(['id' => $this->program, 'name' => $data->program_name, 'description' => $data->program_description]);
|
||||
$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);
|
||||
$this->auth = $this->key;
|
||||
}
|
||||
|
||||
if($data->program) {
|
||||
if(is_object($data->program)) {
|
||||
$this->program = new \Model\Program($data->program);
|
||||
} else {
|
||||
$this->program = new \Model\Program(['id' => $this->program, 'name' => $data->program_name, 'description' => $data->program_description]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +41,7 @@ class Podcast extends Model {
|
||||
}
|
||||
|
||||
public function getSoundfile() {
|
||||
return '/tmp/podcast.mp3';
|
||||
return '/var/audio/podcast/' . $this->soundfilename;
|
||||
}
|
||||
|
||||
public function excerpt() {
|
||||
|
||||
Reference in New Issue
Block a user