diff --git a/blueprints/podcast-episode.yaml b/blueprints/podcast-episode.yaml index 642a055..c47f0e5 100644 --- a/blueprints/podcast-episode.yaml +++ b/blueprints/podcast-episode.yaml @@ -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 diff --git a/podcast.php b/podcast.php index 9a099df..0e3808d 100644 --- a/podcast.php +++ b/podcast.php @@ -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'])) { @@ -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']);