mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-09-30 05:31:22 +02:00
fix(json-ld): add missing properties to PodcastSeries object
rename episode activity cache
This commit is contained in:
parent
cfb3da6592
commit
e97266c5d4
@ -112,7 +112,7 @@ class EpisodeController extends BaseController
|
|||||||
$locale = service('request')
|
$locale = service('request')
|
||||||
->getLocale();
|
->getLocale();
|
||||||
$cacheName =
|
$cacheName =
|
||||||
"page_podcast#{$this->podcast->id}_episode#{$this->episode->id}_{$locale}" .
|
"page_podcast#{$this->podcast->id}_episode#{$this->episode->id}_activity_{$locale}" .
|
||||||
(can_user_interact() ? '_authenticated' : '');
|
(can_user_interact() ? '_authenticated' : '');
|
||||||
|
|
||||||
if (! ($cachedView = cache($cacheName))) {
|
if (! ($cachedView = cache($cacheName))) {
|
||||||
|
@ -21,16 +21,28 @@ use Melbahja\Seo\Schema\Thing;
|
|||||||
if (! function_exists('get_podcast_metatags')) {
|
if (! function_exists('get_podcast_metatags')) {
|
||||||
function get_podcast_metatags(Podcast $podcast, string $page): string
|
function get_podcast_metatags(Podcast $podcast, string $page): string
|
||||||
{
|
{
|
||||||
|
$category = '';
|
||||||
|
if ($podcast->category->parent_id !== null) {
|
||||||
|
$category .= $podcast->category->parent->apple_category . ' > ';
|
||||||
|
}
|
||||||
|
$category .= $podcast->category->apple_category;
|
||||||
|
|
||||||
$schema = new Schema(
|
$schema = new Schema(
|
||||||
new Thing('PodcastSeries', [
|
new Thing('PodcastSeries', [
|
||||||
'name' => $podcast->title,
|
'name' => $podcast->title,
|
||||||
'url' => $podcast->link,
|
'headline' => $podcast->title,
|
||||||
|
'url' => current_url(),
|
||||||
|
'sameAs' => $podcast->link,
|
||||||
|
'identifier' => $podcast->guid,
|
||||||
'image' => $podcast->cover->feed_url,
|
'image' => $podcast->cover->feed_url,
|
||||||
'description' => $podcast->description,
|
'description' => $podcast->description,
|
||||||
'webFeed' => $podcast->feed_url,
|
'webFeed' => $podcast->feed_url,
|
||||||
'author' => new Thing('Person', [
|
'accessMode' => 'auditory',
|
||||||
'name' => $podcast->publisher,
|
'author' => $podcast->owner_name,
|
||||||
]),
|
'creator' => $podcast->owner_name,
|
||||||
|
'publisher' => $podcast->publisher,
|
||||||
|
'inLanguage' => $podcast->language_code,
|
||||||
|
'genre' => $category,
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -70,6 +82,7 @@ if (! function_exists('get_episode_metatags')) {
|
|||||||
'description' => $episode->description,
|
'description' => $episode->description,
|
||||||
'datePublished' => $episode->published_at->format(DATE_ISO8601),
|
'datePublished' => $episode->published_at->format(DATE_ISO8601),
|
||||||
'timeRequired' => iso8601_duration($episode->audio->duration),
|
'timeRequired' => iso8601_duration($episode->audio->duration),
|
||||||
|
'duration' => iso8601_duration($episode->audio->duration),
|
||||||
'associatedMedia' => new Thing('MediaObject', [
|
'associatedMedia' => new Thing('MediaObject', [
|
||||||
'contentUrl' => $episode->audio->file_url,
|
'contentUrl' => $episode->audio->file_url,
|
||||||
]),
|
]),
|
||||||
|
Loading…
Reference in New Issue
Block a user