mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
updated live tv + nuget
This commit is contained in:
parent
fadec6653a
commit
b2b7584352
16 changed files with 544 additions and 46 deletions
|
@ -1 +1,131 @@
|
|||
|
||||
(function ($, document, apiClient) {
|
||||
|
||||
function deleteTimer(page, id) {
|
||||
|
||||
Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Timer Cancellation", function (result) {
|
||||
|
||||
if (result) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.cancelLiveTvSeriesTimer(id).done(function () {
|
||||
|
||||
Dashboard.alert('Series Timer deleted');
|
||||
|
||||
reload(page);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function renderTimers(page, timers) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var cssClass = "detailTable";
|
||||
|
||||
html += '<div class="detailTableContainer"><table class="' + cssClass + '">';
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<th class="tabletColumn"> </th>';
|
||||
html += '<th>Name</th>';
|
||||
html += '<th class="desktopColumn">Channel</th>';
|
||||
html += '<th>Start</th>';
|
||||
html += '<th>End</th>';
|
||||
html += '<th class="tabletColumn">Days</th>';
|
||||
|
||||
html += '</tr>';
|
||||
|
||||
for (var i = 0, length = timers.length; i < length; i++) {
|
||||
|
||||
var timer = timers[i];
|
||||
|
||||
html += '<tr>';
|
||||
|
||||
html += '<td class="tabletColumn">';
|
||||
html += '<button data-timerid="' + timer.Id + '" class="btnDeleteTimer" type="button" data-icon="delete" data-inline="true" data-mini="true" data-iconpos="notext">Delete</button>';
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
html += '<a href="livetvseriestimer.html?id=' + timer.Id + '">' + timer.Name + '</a>';
|
||||
html += '</td>';
|
||||
|
||||
html += '<td class="desktopColumn">';
|
||||
if (timer.ChannelId) {
|
||||
html += '<a href="livetvchannel.html?id=' + timer.ChannelId + '">' + timer.ChannelName + '</a>';
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
var startDate = timer.StartDate;
|
||||
var endDate = timer.StartDate;
|
||||
|
||||
try {
|
||||
|
||||
startDate = parseISO8601Date(startDate, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
endDate = parseISO8601Date(endDate, { toLocal: true });
|
||||
|
||||
} catch (err) {
|
||||
|
||||
}
|
||||
|
||||
html += '<td>' + startDate.toLocaleDateString() + '</td>';
|
||||
html += '<td>' + endDate.toLocaleDateString() + '</td>';
|
||||
|
||||
html += '<td class="tabletColumn">';
|
||||
|
||||
if (timer.DayPattern) {
|
||||
html += timer.DayPattern;
|
||||
}
|
||||
else {
|
||||
var days = timer.Days || [];
|
||||
|
||||
html += days.join(', ');
|
||||
}
|
||||
|
||||
html += '</td>';
|
||||
|
||||
html += '</tr>';
|
||||
}
|
||||
|
||||
html += '</table></div>';
|
||||
|
||||
var elem = $('#items', page).html(html).trigger('create');
|
||||
|
||||
$('.btnDeleteTimer', elem).on('click', function () {
|
||||
|
||||
var id = this.getAttribute('data-timerid');
|
||||
|
||||
deleteTimer(page, id);
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
apiClient.getLiveTvSeriesTimers().done(function (result) {
|
||||
|
||||
renderTimers(page, result.Items);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#liveTvSeriesTimersPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
Loading…
Add table
Add a link
Reference in a new issue