mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 18:56:42 +02:00
fix(import): add extension when downloading file without + truncate slug if too long
This commit is contained in:
parent
d86315ed94
commit
c5f18bb6dc
6 changed files with 43 additions and 32 deletions
|
|
@ -305,11 +305,10 @@ class PodcastImportController extends BaseController
|
|||
);
|
||||
$nsContent = $item->children('http://purl.org/rss/1.0/modules/content/');
|
||||
|
||||
$slug = slugify(
|
||||
$this->request->getPost('slug_field') === 'title'
|
||||
? (string) $item->title
|
||||
: basename((string) $item->link),
|
||||
);
|
||||
$textToSlugify = $this->request->getPost('slug_field') === 'title'
|
||||
? (string) $item->title
|
||||
: basename((string) $item->link);
|
||||
$slug = slugify($textToSlugify, 185);
|
||||
if (in_array($slug, $slugs, true)) {
|
||||
$slugNumber = 2;
|
||||
while (in_array($slug . '-' . $slugNumber, $slugs, true)) {
|
||||
|
|
@ -348,7 +347,10 @@ class PodcastImportController extends BaseController
|
|||
'title' => $item->title,
|
||||
'slug' => $slug,
|
||||
'guid' => $item->guid ?? null,
|
||||
'audio_file' => download_file((string) $item->enclosure->attributes()['url']),
|
||||
'audio_file' => download_file(
|
||||
(string) $item->enclosure->attributes()['url'],
|
||||
(string) $item->enclosure->attributes()['type']
|
||||
),
|
||||
'description_markdown' => $converter->convert($itemDescriptionHtml),
|
||||
'description_html' => $itemDescriptionHtml,
|
||||
'image' => $episodeImage,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue