mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-13 03:27:45 +02:00
fix: update MarkdownEditor component + restyle Button and other components
This commit is contained in:
parent
746b518789
commit
b05d177f1b
35 changed files with 176 additions and 115 deletions
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Entities\Actor;
|
||||
use App\Entities\Podcast;
|
||||
use CodeIgniter\Database\Query;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
|
|
@ -88,7 +89,7 @@ class PodcastModel extends Model
|
|||
protected $validationRules = [
|
||||
'title' => 'required',
|
||||
'handle' =>
|
||||
'required|regex_match[/^[a-zA-Z0-9\_]{1,191}$/]|is_unique[podcasts.handle,id,{id}]',
|
||||
'required|regex_match[/^[a-zA-Z0-9\_]{1,32}$/]|is_unique[podcasts.handle,id,{id}]',
|
||||
'description_markdown' => 'required',
|
||||
'image_path' => 'required',
|
||||
'language_code' => 'required',
|
||||
|
|
@ -102,7 +103,7 @@ class PodcastModel extends Model
|
|||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
protected $beforeInsert = ['createPodcastActor'];
|
||||
protected $beforeInsert = ['setPodcastGUID', 'createPodcastActor'];
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
|
|
@ -489,4 +490,19 @@ class PodcastModel extends Model
|
|||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $data
|
||||
*
|
||||
* @return mixed[]
|
||||
*/
|
||||
protected function setPodcastGUID(array $data): array
|
||||
{
|
||||
if (! array_key_exists('guid', $data['data']) || $data['data']['guid'] === null) {
|
||||
helper('misc');
|
||||
$data['data']['guid'] = podcast_uuid(url_to('podcast_feed', $data['data']['handle']));
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue