Skip to content

Commit

Permalink
Initial work on Issue #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonyea committed Jan 9, 2018
1 parent 06f83f8 commit 7dd1849
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions blueprints/podcast-episode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ form:
type: text
label: Remote Podcast URL
help: Remote files will take precendence over locally hosted when viewed on a page.
header.podcast.audio.remote.recalculate:
type: toggle
label: Recalculate Remote Metadata
help: Set to Yes to recalculate. Set to No to skip downloading and calculating metadata.
options:
1: PLUGIN_ADMIN.YES
0: PLUGIN_ADMIN.NO
validate:
type: bool
default: 1
itunesMetaTab:
type: tab
ordering@: 2
Expand Down
4 changes: 2 additions & 2 deletions podcast.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function onAdminSave($event)
$header = $obj->header();

// Use local file for meta calculations, if present.
// Else use remote file for meta, if present.
// Else use remote file for meta, if present and set to recalculate.
// Else cleanup media entry in markdown header.

if (isset($header->podcast['audio']['local'])) {
Expand All @@ -100,7 +100,7 @@ public function onAdminSave($event)
$audio_meta['duration'] = $this->retreiveAudioDuration($audio_meta['guid']);
$audio_meta['enclosure_length'] = filesize($audio_meta['guid']);
}
if (isset($header->podcast['audio']['remote']) && !isset($audio_meta)) {
if (isset($header->podcast['audio']['remote']) && !isset($audio_meta) && $header->podcast['audio']['remote']['recalculate']) {
// Download fle from external url to temporary location.
$path = $this->getRemoteAudio($header->podcast['audio']['remote']);

Expand Down

0 comments on commit 7dd1849

Please sign in to comment.