/** * Feed list, ready for subscribe button. * * @return array list of prepared feed data-objects */ private function feeds() { return TemplateCache::get_instance()->cache_for('podlove_subscribe_button_feeds', function () { $feeds = array_map(function ($feed) { $file_type = $feed->episode_asset()->file_type(); return ['type' => $file_type->type, 'format' => self::feed_format($file_type->extension), 'url' => $feed->get_subscribe_url(), 'variant' => 'high']; }, $this->discoverable_feeds()); $itunes_feed = Feed::find_one_by_where('itunes_feed_id > 0'); if ($itunes_feed) { // @todo verify the url is valid $feeds[] = ['type' => 'itunes-url', 'url' => 'https://itunes.apple.com/podcast/id' . $itunes_feed->itunes_feed_id]; } return $feeds; }); }