Work on station podcast editor view

This commit is contained in:
Duncan Sommerville 2015-10-21 19:21:52 -04:00
parent 6580c12ad3
commit 814fc67e90
3 changed files with 11 additions and 3 deletions

View File

@ -176,18 +176,22 @@ class Rest_PodcastController extends Zend_Rest_Controller
$ids = $this->_getParam('ids', []);
$method = $this->_getParam('method', 'GET');
$path = 'podcast/podcast.phtml';
$responseBody = [];
switch($method) {
case "DELETE":
foreach($ids as $id) {
Application_Service_PodcastService::deletePodcastById($id);
$responseBody = "Success"; // TODO: make this more descriptive
}
// XXX: do we need this to be more descriptive?
$responseBody = "Successfully deleted podcasts";
break;
case "GET":
foreach($ids as $id) {
// Check the StationPodcast table rather than checking
// the station podcast ID key in preferences for extensibility
$podcast = StationPodcastQuery::create()->findOneByDbPodcastId($id);
$path = $podcast ? 'podcast/station_podcast.phtml' : 'podcast/podcast.phtml';
$podcast = Application_Service_PodcastService::getPodcastById($id);
$responseBody[] = array(
"podcast"=>json_encode($podcast),

View File

@ -309,7 +309,9 @@ class Application_Service_PodcastService
self::removePrivateFields($data["podcast"]);
self::validatePodcastMetadata($data["podcast"]);
self::_updateAutoIngestTimestamp($podcast, $data);
if (array_key_exists("auto_ingest", $data["podcast"])) {
self::_updateAutoIngestTimestamp($podcast, $data);
}
$podcast->fromArray($data["podcast"], BasePeer::TYPE_FIELDNAME);
$podcast->save();

View File

@ -26,6 +26,8 @@ var AIRTIME = (function (AIRTIME) {
$http.put(endpoint + $scope.podcast.id, { csrf_token: jQuery("#csrf").val(), podcast: podcastData })
.success(function() {
episodeTable.reload($scope.podcast.id);
AIRTIME.library.podcastDataTable.fnDraw();
tab.setName($scope.podcast.title);
});
};