fix(rss): set srt transcripts' mimetype to application/x-subrip with rel="captions" attribute

closes #360
This commit is contained in:
Yassine Doghri 2023-07-29 08:27:06 +00:00
parent 6833dd05ab
commit 16a3fdb56e
2 changed files with 4 additions and 1 deletions

View File

@ -276,7 +276,7 @@ class Mimes
],
'svg' => ['image/svg+xml', 'image/svg', 'application/xml', 'text/xml'],
'vcf' => 'text/x-vcard',
'srt' => ['text/srt', 'text/plain', 'application/octet-stream'],
'srt' => ['application/x-subrip', 'text/srt', 'text/plain', 'application/octet-stream'],
'vtt' => ['text/vtt', 'text/plain'],
'ico' => ['image/x-icon', 'image/x-ico', 'image/vnd.microsoft.icon'],
'stl' => ['application/sla', 'application/vnd.ms-pki.stl', 'application/x-navistyle'],

View File

@ -360,6 +360,9 @@ if (! function_exists('get_rss_feed')) {
pathinfo($episode->transcript->file_url, PATHINFO_EXTENSION)
) ?? 'text/html',
);
// Castopod only allows for captions (SubRip files)
$transcriptElement->addAttribute('rel', 'captions');
// TODO: allow for multiple languages
$transcriptElement->addAttribute('language', $podcast->language_code);
}