feat(plugins): add before channel/item hooks to allow podcast/episode data edit when generating rss

This commit is contained in:
Yassine Doghri 2024-05-17 14:01:04 +00:00
commit 80d2c48ee2
15 changed files with 44 additions and 27 deletions

View file

@ -52,7 +52,7 @@ abstract class BasePlugin implements PluginInterface
// TODO: cache manifest data
$manifestPath = $directory . '/manifest.json';
$manifestContents = file_get_contents($manifestPath);
$manifestContents = @file_get_contents($manifestPath);
if (! $manifestContents) {
$manifestContents = '{}';
@ -93,18 +93,19 @@ abstract class BasePlugin implements PluginInterface
$this->{$name} = $value;
}
public function init(): void
{
// add to admin navigation
// TODO: setup navigation and views?
}
public function channelTag(Podcast $podcast, SimpleRSSElement $channel): void
public function rssBeforeChannel(Podcast $podcast): void
{
}
public function itemTag(Episode $episode, SimpleRSSElement $item): void
public function rssAfterChannel(Podcast $podcast, SimpleRSSElement $channel): void
{
}
public function rssBeforeItem(Episode $episode): void
{
}
public function rssAfterItem(Episode $episode, SimpleRSSElement $item): void
{
}