Fix issue with automatic ingest; shift episode ingest to PodcastEpisodesController

This commit is contained in:
Duncan Sommerville 2015-10-22 12:12:41 -04:00
parent 23ccc268d1
commit 9302027a2b
8 changed files with 75 additions and 37 deletions

View file

@ -25,6 +25,20 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir
self::DOWNLOAD => 'podcast-download'
];
/**
* Utility function to import and download a single episode
*
* @param int $podcastId ID of the podcast the episode should belong to
* @param array $episode array of episode data to store
*
* @return PodcastEpisodes the stored PodcastEpisodes object
*/
public function importEpisode($podcastId, $episode) {
$e = $this->addPlaceholder($podcastId, $episode);
$this->_download($e->getDbId(), $e->getDbDownloadUrl());
return $e;
}
/**
* Given an array of episodes, store them in the database as placeholder objects until
* they can be processed by Celery