Changes by CLaude
Build and Deploy / build (push) Failing after 44s

This commit is contained in:
root
2026-08-18 09:31:05 -01:00
parent 9bee381f6c
commit 30893eb7a7
21 changed files with 276 additions and 85 deletions
+32 -3
View File
@@ -21,10 +21,31 @@ class Podcast extends Model {
private $key;
public function __construct($data) {
// Convert arrays to objects for consistent handling
if(is_array($data)) {
$data = (object) $data;
}
parent::__construct($data);
// Ensure id is a string, not an array
if(is_array($this->id)) {
$this->id = $this->id[0] ?? '';
}
// Ensure title is a string, not an array
if(is_array($this->title)) {
$this->title = $this->title[0] ?? '';
}
// Ensure image is not an array from API
if(is_array($this->image)) {
$this->image = null;
}
parent::ConvertToDateTime($this->created);
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title) . '.mp3';
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title ?? '') . '.mp3';
if($this->soundfilename) {
// Only generate when not constructing from a JSON object
$this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename);
@@ -36,7 +57,15 @@ class Podcast extends Model {
if(is_object($data->program)) {
$this->program = new \Model\Program($data->program);
} elseif($data->program) {
$this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]);
$program_name = $data->program_name ?? null;
if(is_array($program_name)) {
$program_name = $program_name[0] ?? null;
}
$program_desc = $data->program_description ?? null;
if(is_array($program_desc)) {
$program_desc = $program_desc[0] ?? null;
}
$this->program = new \Model\Program((object) ['id' => $data->program, 'name' => $program_name, 'description' => $program_desc]);
}
}
@@ -44,7 +73,7 @@ class Podcast extends Model {
$imagedata = new \stdClass();
$imagedata->id = $this->id;
$imagedata->file = $data->imagefile;
$imagedata->title = $data->imagecaption;
$imagedata->title = $data->imagecaption ?? null;
$this->image = new NewsImage($imagedata, '/img/podcast/');
}