* SAAS-1084 - initial work on publishing API backend

* More work on automatic ingest
* Add automatic_ingest_timestamp column to ImportedPodcast
This commit is contained in:
Duncan Sommerville 2015-10-20 19:03:34 -04:00
parent 3a791ef9b5
commit 0b1df6baf3
27 changed files with 490 additions and 106 deletions

View file

@ -17,6 +17,8 @@ var AIRTIME = (function (AIRTIME) {
var publishApp = angular.module(PUBLISH_APP_NAME, [])
.controller('RestController', function($scope, $http, mediaId, tab) {
$scope.publishSources = {};
$http.get(endpoint + mediaId, { csrf_token: jQuery("#csrf").val() })
.success(function(json) {
console.log(json);
@ -24,8 +26,12 @@ var AIRTIME = (function (AIRTIME) {
tab.setName($scope.media.track_title);
});
$scope.save = function() {
$http.put(endpoint + $scope.media.id, { csrf_token: jQuery("#csrf").val(), media: $scope.media })
$scope.publish = function() {
var sources = {};
$.each($scope.publishSources, function(k, v) {
if (v) sources[k] = 'publish'; // Tentative TODO: decide on a robust implementation
});
$http.put(endpoint + $scope.media.id + '/publish', { csrf_token: jQuery("#csrf").val(), sources: sources })
.success(function() {
// TODO
});