Fix tabs bugs and podcast auto-ingest error
This commit is contained in:
parent
d08e19a93a
commit
9af7f6dcdd
5 changed files with 26 additions and 19 deletions
|
@ -35,9 +35,11 @@ class PodcastManager {
|
|||
// that we're ingesting.
|
||||
// Note that this folds to the failure case (Celery task timeout/download failure)
|
||||
// but will at least continue to ingest new episodes.
|
||||
if (!empty($episodes)) {
|
||||
$podcast->setDbAutoIngestTimestamp(gmdate('r', strtotime($episodes[0]->getDbPublicationDate())))->save();
|
||||
$service->downloadEpisodes($episodes);
|
||||
}
|
||||
}
|
||||
|
||||
Application_Model_Preference::setPodcastPollLock(microtime(true));
|
||||
}
|
||||
|
|
|
@ -374,10 +374,10 @@ var AIRTIME = (function(AIRTIME) {
|
|||
//buildEditMetadataDialog(json);
|
||||
});
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.tr_id, baseUrl + 'playlist/edit');
|
||||
AIRTIME.playlist.fnEdit(data, baseUrl + 'playlist/edit');
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
} else if (data.ftype === "stream") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.tr_id, baseUrl + 'webstream/edit');
|
||||
AIRTIME.playlist.fnEdit(data, baseUrl + 'webstream/edit');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1080,12 +1080,12 @@ var AIRTIME = (function(AIRTIME) {
|
|||
};
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
callback = function() {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.tr_id, baseUrl+'playlist/edit');
|
||||
AIRTIME.playlist.fnEdit(data, baseUrl+'playlist/edit');
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
};
|
||||
} else if (data.ftype === "stream") {
|
||||
callback = function() {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.tr_id, baseUrl + 'webstream/edit');
|
||||
AIRTIME.playlist.fnEdit(data, baseUrl + 'webstream/edit');
|
||||
}
|
||||
} else {
|
||||
throw new Exception($.i18n._("Unknown type: ") + data.ftype);
|
||||
|
|
|
@ -849,12 +849,12 @@ var AIRTIME = (function(AIRTIME){
|
|||
// TODO: refactor - this code is pretty finicky...
|
||||
if ((name == $.i18n._("Untitled Playlist")
|
||||
|| name == $.i18n._("Untitled Smart Block"))
|
||||
&& $pl.find(".spl_sortable .spl_empty").length == 1) {
|
||||
&& tab.contents.find(".spl_sortable .spl_empty").length == 1) {
|
||||
mod.fnDelete(undefined, tab);
|
||||
} else {
|
||||
tab.close();
|
||||
}
|
||||
|
||||
tab.close();
|
||||
|
||||
$.ajax( {
|
||||
url : baseUrl+"usersettings/set-library-screen-settings",
|
||||
type : "POST",
|
||||
|
@ -1117,14 +1117,13 @@ var AIRTIME = (function(AIRTIME){
|
|||
AIRTIME.tabs.openTab(json.html, uid, AIRTIME.playlist._initFileMdEvents);
|
||||
};
|
||||
|
||||
mod.fnEdit = function(id, uid, url) {
|
||||
//openPlaylistPanel();
|
||||
mod.fnEdit = function(data, url) {
|
||||
stopAudioPreview();
|
||||
|
||||
$.post(url,
|
||||
{format: "json", id: id, type: type},
|
||||
{format: "json", id: data.id, type: data.ftype},
|
||||
function(json) {
|
||||
AIRTIME.tabs.openTab(json.html, uid, AIRTIME.playlist._initPlaylistTabEvents);
|
||||
AIRTIME.tabs.openTab(json.html, data.tr_id, AIRTIME.playlist._initPlaylistTabEvents);
|
||||
redrawLib();
|
||||
});
|
||||
};
|
||||
|
@ -1139,10 +1138,12 @@ var AIRTIME = (function(AIRTIME){
|
|||
type = pl.find('.obj_type').val();
|
||||
url = baseUrl+'playlist/delete';
|
||||
|
||||
console.log(id);
|
||||
console.log(type);
|
||||
|
||||
$.post(url,
|
||||
{format: "json", ids: id, modified: lastMod, type: type},
|
||||
function(json) {
|
||||
tab.close();
|
||||
redrawLib();
|
||||
});
|
||||
};
|
||||
|
@ -1485,14 +1486,17 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.setCurrent = function(pl) {
|
||||
$pl = pl;
|
||||
|
||||
var type = $pl.find('.obj_type').val();
|
||||
if ($.inArray(type, Object.keys(AIRTIME.library.MediaTypeFullToStringEnum)) > -1) {
|
||||
$.post(baseUrl + "playlist/change-playlist", {
|
||||
"id": mod.getId($pl),
|
||||
"type": $pl.find('.obj_type').val()
|
||||
id: mod.getId($pl),
|
||||
type: type
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
mod.init = function() {
|
||||
AIRTIME.tabs.updateActiveTab();
|
||||
if (!$pl) return;
|
||||
|
||||
$pl.delegate(".pl-waveform-cues-btn", {"click": function(ev){
|
||||
|
|
|
@ -253,6 +253,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
*/
|
||||
mod.initScheduleTab = function() {
|
||||
$scheduleTab = Object.freeze(new ScheduleTab());
|
||||
$activeTab = $scheduleTab;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue