diff --git a/app/Entities/Episode.php b/app/Entities/Episode.php index 454849e1..6b4939a5 100644 --- a/app/Entities/Episode.php +++ b/app/Entities/Episode.php @@ -50,6 +50,11 @@ class Episode extends Entity */ protected $enclosure_web_url; + /** + * @var string + */ + protected $enclosure_opengraph_url; + /** * Holds text only description, striped of any markdown or html special characters * @@ -220,6 +225,11 @@ class Episode extends Entity return $this->getEnclosureUrl() . '?_from=-+Website+-'; } + public function getEnclosureOpengraphUrl() + { + return $this->getEnclosureUrl() . '?_from=-+Open+Graph+-'; + } + public function getLink() { return base_url( diff --git a/app/Helpers/url_helper.php b/app/Helpers/url_helper.php index 1e35a594..ec462ca8 100644 --- a/app/Helpers/url_helper.php +++ b/app/Helpers/url_helper.php @@ -20,3 +20,21 @@ if (!function_exists('host_url')) { return false; } } + +if (!function_exists('current_season_url')) { + /** + * Return the podcast URL with season number to use in views + * + * @return string + */ + function current_season_url() + { + $season_query_string = ''; + if (isset($_GET['season'])) { + $season_query_string = '?season=' . $_GET['season']; + } elseif (isset($_GET['year'])) { + $season_query_string = '?year=' . $_GET['year']; + } + return current_url() . $season_query_string; + } +} diff --git a/app/Views/episode.php b/app/Views/episode.php index 93d3166c..f97ff387 100644 --- a/app/Views/episode.php +++ b/app/Views/episode.php @@ -9,7 +9,23 @@ + + + + + + + + + + + + + + diff --git a/app/Views/podcast.php b/app/Views/podcast.php index 98258d0d..fa25f602 100644 --- a/app/Views/podcast.php +++ b/app/Views/podcast.php @@ -10,8 +10,20 @@ + + + + + + + + + +