Update JSON notes feed to version 1.1

This commit is contained in:
Jonny Barnes 2023-12-20 14:44:11 +00:00
parent 24ca9f86d2
commit 2aa60db548
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
4 changed files with 20 additions and 13 deletions

View file

@ -144,17 +144,17 @@ class Note extends Model
*/
public function getContentAttribute(): string
{
$note = $this->note;
$note = $this->getRawOriginal('note');
foreach ($this->media as $media) {
if ($media->type === 'image') {
$note .= '<img src="' . $media->url . '" alt="">';
$note .= PHP_EOL . '<img src="' . $media->url . '" alt="">';
}
if ($media->type === 'audio') {
$note .= '<audio src="' . $media->url . '">';
$note .= PHP_EOL . '<audio src="' . $media->url . '">';
}
if ($media->type === 'video') {
$note .= '<video src="' . $media->url . '">';
$note .= PHP_EOL . '<video src="' . $media->url . '">';
}
}