Skip to content
Commits on Source (5)
## [1.5.1](https://code.castopod.org/adaures/castopod/compare/v1.5.0...v1.5.1) (2023-07-29)
### Bug Fixes
- **admin-ui:** remove button labels on smaller screens in podcast view
([9cc5ffd](https://code.castopod.org/adaures/castopod/commit/9cc5ffd1439fdc86f46a03f4319cae32db95f84e))
- **rss:** set srt transcripts' mimetype to application/x-subrip with
rel="captions" attribute
([16a3fdb](https://code.castopod.org/adaures/castopod/commit/16a3fdb56e3f07185e75d106216f29519ccb25f7)),
closes [#360](https://code.castopod.org/adaures/castopod/issues/360)
- **rss:** update podcast extension namespace
([6833dd0](https://code.castopod.org/adaures/castopod/commit/6833dd05ab51bc530d34fd4174ad732f623226c0)),
closes [#360](https://code.castopod.org/adaures/castopod/issues/360)
# [1.5.0](https://code.castopod.org/adaures/castopod/compare/v1.4.7...v1.5.0) (2023-07-27)
### Bug Fixes
......
......@@ -11,7 +11,7 @@ declare(strict_types=1);
|
| NOTE: this constant is updated upon release with Continuous Integration.
*/
defined('CP_VERSION') || define('CP_VERSION', '1.5.0');
defined('CP_VERSION') || define('CP_VERSION', '1.5.1');
/*
| --------------------------------------------------------------------
......
......@@ -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'],
......
......@@ -598,7 +598,7 @@ class Episode extends Entity
helper('rss');
$xmlNode = (new SimpleRSSElement(
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
))
->addChild('channel')
->addChild('item');
......@@ -622,7 +622,7 @@ class Episode extends Entity
helper('rss');
$customXML = simplexml_load_string(
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><item>' .
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><item>' .
$customRssString .
'</item></channel></rss>',
);
......
......@@ -642,7 +642,7 @@ class Podcast extends Entity
helper('rss');
$xmlNode = (new SimpleRSSElement(
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"/>',
))->addChild('channel');
array_to_rss([
'elements' => $this->custom_rss,
......@@ -664,7 +664,7 @@ class Podcast extends Entity
helper('rss');
$customRssArray = rss_to_array(
simplexml_load_string(
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel>' .
'<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:podcast="https://podcastindex.org/namespace/1.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel>' .
$customRssString .
'</channel></rss>',
),
......
......@@ -35,8 +35,7 @@ if (! function_exists('get_rss_feed')) {
$itunesNamespace = 'http://www.itunes.com/dtds/podcast-1.0.dtd';
$podcastNamespace =
'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md';
$podcastNamespace = 'https://podcastindex.org/namespace/1.0';
$atomNamespace = 'http://www.w3.org/2005/Atom';
......@@ -361,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);
}
......@@ -450,11 +452,7 @@ if (! function_exists('rss_to_array')) {
*/
function rss_to_array(SimpleXMLElement $rssNode): array
{
$nameSpaces = [
'',
'http://www.itunes.com/dtds/podcast-1.0.dtd',
'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md',
];
$nameSpaces = ['', 'http://www.itunes.com/dtds/podcast-1.0.dtd', 'https://podcastindex.org/namespace/1.0'];
$arrayNode = [];
$arrayNode['name'] = $rssNode->getName();
$arrayNode['namespace'] = $rssNode->getNamespaces(false);
......
......@@ -96,7 +96,7 @@ class ComponentRenderer
private function renderPairedTags(string $output): string
{
$pattern = '/<\s*(?<name>[A-Z][A-Za-z0-9\.]*?)(?<attributes>[\s\S\=\'\"]*)>(?<slot>.*)<\/\s*\1\s*>/uUsm';
$pattern = '/<\s*(?<name>[A-Z][A-Za-z0-9\.]*?)(?<attributes>(\s*[\w\-]+\s*=\s*(\'[^\']*\'|\"[^\"]*\"))+\s*)>(?<slot>.*)<\/\s*\1\s*>/uUsm';
ini_set('pcre.backtrack_limit', '-1');
/*
$matches[0] = full tags matched and all of its content
......
......@@ -500,7 +500,7 @@ class PodcastModel extends Model
* @param mixed[] $data
*
* Sets the UUIDv5 for a podcast. For more information, see
* https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#guid
* https://podcastindex.org/namespace/1.0#guid
*
* @return mixed[]
*/
......
......@@ -81,6 +81,10 @@ class Button extends Component
unset($this->attributes['class']);
}
if ($this->iconLeft !== '' || $this->iconRight !== '') {
$this->slot = '<span>' . $this->slot . '</span>';
}
if ($this->iconLeft !== '') {
$this->slot = (new Icon([
'glyph' => $this->iconLeft,
......
{
"name": "adaures/castopod",
"version": "1.5.0",
"version": "1.5.1",
"type": "project",
"description": "Castopod is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"homepage": "https://castopod.org",
......
......@@ -4,7 +4,7 @@ networks:
castopod:
ipam:
config:
- subnet: 172.20.0.0/24
- subnet: 172.100.0.0/24
services:
app:
......@@ -22,7 +22,7 @@ services:
- mariadb
networks:
castopod:
ipv4_address: 172.20.0.2
ipv4_address: 172.100.0.2
redis:
image: redis:alpine
......@@ -33,7 +33,7 @@ services:
- redis:/data
networks:
castopod:
ipv4_address: 172.20.0.3
ipv4_address: 172.100.0.3
mariadb:
image: mariadb:10.2
......@@ -50,7 +50,7 @@ services:
MYSQL_PASSWORD: castopod
networks:
castopod:
ipv4_address: 172.20.0.4
ipv4_address: 172.100.0.4
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
......@@ -67,7 +67,7 @@ services:
- mariadb
networks:
castopod:
ipv4_address: 172.20.0.5
ipv4_address: 172.100.0.5
s3:
image: adobe/s3mock:latest
......@@ -82,7 +82,7 @@ services:
- ./data/s3:/data:cached
networks:
castopod:
ipv4_address: 172.20.0.6
ipv4_address: 172.100.0.6
volumes:
redis:
......
......@@ -74,7 +74,7 @@ to help you kickstart your contribution.
# -----------------------
#media.fileManager="s3"
#media.s3.bucket="castopod"
#media.s3.endpoint="http://172.20.0.6:9090/"
#media.s3.endpoint="http://172.100.0.6:9090/"
#media.s3.pathStyleEndpoint=true
```
......
......@@ -209,6 +209,11 @@ class PodcastImport extends BaseCommand
throw new Exception('Missing podcast cover. Please include an <itunes:image> tag');
}
$parentalAdvisory = null;
if ($this->podcastFeed->channel->itunes_explicit->getValue() !== null) {
$parentalAdvisory = $this->podcastFeed->channel->itunes_explicit->getValue() ? 'explicit' : 'clean';
}
$htmlConverter = new HtmlConverter();
$podcast = new Podcast([
'created_by' => $this->user->id,
......@@ -224,7 +229,7 @@ class PodcastImport extends BaseCommand
'banner' => null,
'language_code' => $this->importTask->language,
'category_id' => $this->importTask->category,
'parental_advisory' => $this->podcastFeed->channel->itunes_explicit->getValue(),
'parental_advisory' => $parentalAdvisory,
'owner_name' => $this->podcastFeed->channel->itunes_owner->itunes_name->getValue(),
'owner_email' => $this->podcastFeed->channel->itunes_owner->itunes_email->getValue(),
'publisher' => $this->podcastFeed->channel->itunes_author->getValue(),
......@@ -439,6 +444,11 @@ class PodcastImport extends BaseCommand
$coverUrl = $this->getCoverUrl($item);
$parentalAdvisory = null;
if ($item->itunes_explicit->getValue() !== null) {
$parentalAdvisory = $item->itunes_explicit->getValue() ? 'explicit' : 'clean';
}
$episode = new Episode([
'created_by' => $this->user->id,
'updated_by' => $this->user->id,
......@@ -455,7 +465,7 @@ class PodcastImport extends BaseCommand
'description_markdown' => $htmlConverter->convert($showNotes),
'description_html' => $showNotes,
'cover' => $coverUrl ? download_file($coverUrl) : null,
'parental_advisory' => $item->itunes_explicit->getValue(),
'parental_advisory' => $parentalAdvisory,
'number' => $item->itunes_episode->getValue(),
'season_number' => $item->itunes_season->getValue(),
'type' => $item->itunes_episodeType->getValue(),
......
{
"name": "castopod",
"version": "1.5.0",
"version": "1.5.1",
"description": "Castopod Host is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"private": true,
"license": "AGPL-3.0-or-later",
......
......@@ -16,7 +16,7 @@ $userPodcasts = get_podcasts_user_can_interact_with(auth()->user()); ?>
'home',
) ?>" class="inline-flex items-center h-full px-2 text-sm font-semibold sm:px-6 hover:underline focus:ring-inset focus:ring-accent" title="<?= lang('Navigation.go_to_website') ?>">
<span class="hidden sm:block"><?= lang('Navigation.go_to_website') ?></span>
<?= icon('external-link', 'ml-1 text-xl sm:opacity-60') ?>
<?= icon('external-link', 'sm:ml-1 text-xl sm:text-base sm:opacity-60') ?>
</a>
</div>
<div class="inline-flex items-center h-full ml-auto">
......
......@@ -9,8 +9,8 @@
<?= $this->endSection() ?>
<?= $this->section('headerRight') ?>
<Button uri="<?= route_to('podcast-edit', $podcast->id) ?>" variant="secondary" iconLeft="edit"><?= lang('Podcast.edit') ?></Button>
<Button uri="<?= route_to('episode-create', $podcast->id) ?>" variant="primary" iconLeft="add"><?= lang('Episode.create') ?></Button>
<Button uri="<?= route_to('podcast-edit', $podcast->id) ?>" variant="secondary" class="[&>span]:hidden [&>span]:md:block py-3 md:py-2" iconLeft="edit"><?= lang('Podcast.edit') ?></Button>
<Button uri="<?= route_to('episode-create', $podcast->id) ?>" variant="primary" class="[&>span]:hidden [&>span]:md:block py-3 md:py-2" iconLeft="add"><?= lang('Episode.create') ?></Button>
<?= $this->endSection() ?>
<?= $this->section('content') ?>
......