Exemple #1
0
 /**
  * Dynamically return file url from release, format and show.
  *
  * @return string
  */
 public function get_file_url()
 {
     $podcast = Podcast::get_instance();
     $episode = $this->episode();
     $episode_asset = EpisodeAsset::find_by_id($this->episode_asset_id);
     $file_type = FileType::find_by_id($episode_asset->file_type_id);
     if (!$episode_asset || !$file_type || !$episode->slug) {
         return '';
     }
     $template = $episode_asset->url_template;
     $template = str_replace('%media_file_base_url%', $podcast->media_file_base_uri, $template);
     $template = str_replace('%episode_slug%', $episode->slug, $template);
     $template = str_replace('%format_extension%', $file_type->extension, $template);
     return $template;
 }
Exemple #2
0
 /**
  * Get title for browser feed discovery.
  *
  * This title is used by clients to show the user the subscribe option he
  * has. Therefore, the most obvious thing to do is to display the show
  * title and the file extension in paranthesis.
  *
  * Fallback to internal feed name.
  * 
  * @return string
  */
 public function title_for_discovery()
 {
     $podcast = Podcast::get_instance();
     $episode_asset = $this->episode_asset();
     if (!$episode_asset) {
         return $this->name;
     }
     $file_type = $episode_asset->file_type();
     if (!$file_type) {
         return $this->name;
     }
     $file_extension = $file_type->extension;
     $title = sprintf(__('Podcast Feed: %s (%s)', 'podcast'), $podcast->title, $this->name);
     $title = apply_filters('podlove_feed_title_for_discovery', $title, $this->title, $file_extension, $this->id);
     return $title;
 }
Exemple #3
0
 public function get_cover_art()
 {
     $podcast = Podcast::get_instance();
     if ($podcast->supports_cover_art == 0) {
         return;
     }
     if ($podcast->supports_cover_art == 'manual') {
         return $this->cover_art;
     }
     $cover_art_file_id = $podcast->supports_cover_art;
     if (!($asset = EpisodeAsset::find_one_by_id($cover_art_file_id))) {
         return false;
     }
     if (!($file = MediaFile::find_by_episode_id_and_episode_asset_id($this->id, $asset->id))) {
         return false;
     }
     return $file->get_file_url();
 }
Exemple #4
0
     * Generate a human readable title.
     * 
     * Return name and, if available, the subtitle. Separated by a dash.
     * 
     * @return string
     */
    public function full_title()
    {
        $t = $this->title;
        if ($this->subtitle) {
            $t = $t . ' - ' . $this->subtitle;
        }
        return $t;
    }
}
$podcast = Podcast::get_instance();
$podcast->property('title');
$podcast->property('slug');
// identifier
// Identifiers
// nsfw    - slug (url/file)
// NSFW    - podcast id / short name
// NSFW002 - episode id
// 2       - episode number
$podcast->property('subtitle');
$podcast->property('cover_image');
$podcast->property('summary');
$podcast->property('author_name');
$podcast->property('owner_name');
$podcast->property('owner_email');
$podcast->property('keywords');