1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

more support for episodes directly in a series folder

This commit is contained in:
Luke Pulverenti 2013-12-03 23:18:50 -05:00
parent b8c8a794f3
commit e38caab270
15 changed files with 217 additions and 65 deletions

View file

@ -1,19 +1,99 @@
function deleteRecording(page, id) {
(function ($, document, apiClient) {
Dashboard.confirm("Are you sure you wish to delete this recording?", "Confirm Recording Deletion", function (result) {
var currentItem;
if (result) {
function deleteRecording() {
Dashboard.showLoadingMsg();
Dashboard.confirm("Are you sure you wish to delete this recording?", "Confirm Recording Deletion", function (result) {
ApiClient.deleteLiveTvRecording(id).done(function () {
if (result) {
Dashboard.alert('Recording deleted');
Dashboard.showLoadingMsg();
reload(page);
});
ApiClient.deleteLiveTvRecording(currentItem.Id).done(function () {
Dashboard.alert('Recording deleted');
Dashboard.navigate('livetvrecordings.html');
});
}
});
}
function renderRecording(page, item) {
currentItem = item;
var name = item.Name;
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
Dashboard.setPageTitle(name);
$('.itemName', page).html(name);
$('.itemChannelNumber', page).html(item.Number);
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
if (ApiClient.isWebSocketOpen()) {
var vals = [item.Type, item.Id, item.Name];
vals.push('livetv');
ApiClient.sendWebSocketMessage("Context", vals.join('|'));
}
});
}
if (MediaPlayer.canPlay(item)) {
$('#playButtonContainer', page).show();
} else {
$('#playButtonContainer', page).hide();
}
Dashboard.getCurrentUser().done(function (user) {
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
$('#deleteButtonContainer', page).show();
} else {
$('#deleteButtonContainer', page).hide();
}
});
Dashboard.hideLoadingMsg();
}
function reload(page) {
Dashboard.showLoadingMsg();
var id = getParameterByName('id');
apiClient.getLiveTvRecording(id).done(function (result) {
renderRecording(page, result);
});
}
$(document).on('pageinit', "#liveTvRecordingPage", function () {
var page = this;
$('#btnDelete', page).on('click', deleteRecording);
}).on('pagebeforeshow', "#liveTvRecordingPage", function () {
var page = this;
reload(page);
}).on('pagehide', "#liveTvRecordingPage", function () {
currentItem = null;
});
})(jQuery, document, ApiClient);