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

@ -291,6 +291,28 @@ class Application_Service_PodcastService
}
}
/**
* Build a response with podcast data and embedded HTML to load on the frontend
*
* @param int $podcastId ID of the podcast to build a response for
* @param Zend_View_Interface $view Zend view object to render the response HTML
*
* @return array the response array containing the podcast data and editor HTML
*
* @throws PodcastNotFoundException
*/
public static function buildPodcastEditorResponse($podcastId, $view) {
// Check the StationPodcast table rather than checking
// the station podcast ID key in preferences for extensibility
$podcast = StationPodcastQuery::create()->findOneByDbPodcastId($podcastId);
$path = $podcast ? 'podcast/station_podcast.phtml' : 'podcast/podcast.phtml';
$podcast = Application_Service_PodcastService::getPodcastById($podcastId);
return array(
"podcast" => json_encode($podcast),
"html" => $view->render($path),
);
}
/**
* Updates a Podcast object with the given metadata
*