SAAS-1071 - more work on celery backend for podcasts; add upgrade to make file_id field in third_party_track_references nullable

This commit is contained in:
Duncan Sommerville 2015-09-24 15:57:38 -04:00
parent a24565669b
commit 43e9fb59ce
11 changed files with 127 additions and 58 deletions

View file

@ -125,8 +125,11 @@ class Rest_PodcastController extends Zend_Rest_Controller
try {
$requestData = json_decode($this->getRequest()->getRawBody(), true);
$this->_service->downloadEpisodes($requestData["podcast"]["episodes"]);
// Create placeholders in PodcastEpisodes so we know these episodes are being downloaded
// to prevent the user from trying to download them again while Celery is running
$episodes = $this->_service->addPodcastEpisodePlaceholders($requestData["podcast"]["id"],
$requestData["podcast"]["episodes"]);
$this->_service->downloadEpisodes($episodes);
$podcast = Podcast::updateFromArray($id, $requestData);
$this->getResponse()