mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Added SupportsAutoRunAtStartup
This commit is contained in:
parent
669c832ce6
commit
6e5adce35c
7 changed files with 230 additions and 23 deletions
|
@ -11,7 +11,7 @@
|
|||
<form id="advancedConfigurationForm">
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<li id="fldRunAtStartup" style="display:none;">
|
||||
<input type="checkbox" id="chkRunAtStartup" name="chkRunAtStartup" data-mini="true" />
|
||||
<label for="chkRunAtStartup">Run server at startup</label>
|
||||
<div id="windowsStartupDescription" class="fieldDescription warningFieldDescription" style="display: none;">
|
||||
|
|
|
@ -123,3 +123,37 @@
|
|||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.timeslotHeaders {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.timeslotHeader {
|
||||
width: 100px;
|
||||
display: inline-block;
|
||||
padding: .5em .5em;
|
||||
background: #38c;
|
||||
}
|
||||
|
||||
.timeslotCell {
|
||||
width: 100px;
|
||||
display: inline-block;
|
||||
padding: .5em .5em;
|
||||
|
||||
border: 1px solid #444;
|
||||
border-collapse: collapse;
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.channelTimeslotCell {
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.channelTimeslotHeader, .channelTimeslotCell {
|
||||
width: 80px;
|
||||
color: #ddd;
|
||||
}
|
||||
.guideChannel {
|
||||
}
|
|
@ -13,6 +13,15 @@
|
|||
<a href="livetvseriestimers.html">Series</a>
|
||||
</div>
|
||||
<div data-role="content">
|
||||
|
||||
<div>
|
||||
<h2 class="detailSectionHeader tvProgramSectionHeader guideDate"></h2>
|
||||
|
||||
<div style="overflow-x: scroll;overflow-y:scroll;position:absolute;right: 1em;left: 1em;top: 135px;bottom: 30px;">
|
||||
<div class="timeslotHeaders"></div>
|
||||
<div id="guide"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -10,6 +10,12 @@
|
|||
$('#windowsStartupDescription', page).hide();
|
||||
}
|
||||
|
||||
if (systemInfo.SupportsAutoRunAtStartup) {
|
||||
$('#fldRunAtStartup', page).show();
|
||||
} else {
|
||||
$('#fldRunAtStartup', page).hide();
|
||||
}
|
||||
|
||||
if (systemInfo.SupportsNativeWebSocket) {
|
||||
|
||||
$('#fldWebSocketPortNumber', page).hide();
|
||||
|
|
|
@ -391,8 +391,8 @@
|
|||
html += LibraryBrowser.getSongHeaderCellHtml('Album', '', options.enableColumnSorting, 'Album,SortName', options.sortBy, options.sortOrder);
|
||||
}
|
||||
if (options.showArtist) {
|
||||
html += LibraryBrowser.getSongHeaderCellHtml('Album Artist', 'tabletColumn', options.enableColumnSorting, 'AlbumArtist,Album,SortName', options.sortBy, options.sortOrder);
|
||||
html += LibraryBrowser.getSongHeaderCellHtml('Artist', '', options.enableColumnSorting, 'Artist,Album,SortName', options.sortBy, options.sortOrder);
|
||||
html += LibraryBrowser.getSongHeaderCellHtml('Album Artist', 'tabletColumn', options.enableColumnSorting, 'AlbumArtist,Album,SortName', options.sortBy, options.sortOrder);
|
||||
}
|
||||
|
||||
html += LibraryBrowser.getSongHeaderCellHtml('Runtime', 'tabletColumn', options.enableColumnSorting, 'Runtime,AlbumArtist,Album,SortName', options.sortBy, options.sortOrder);
|
||||
|
@ -427,17 +427,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (options.showArtist) {
|
||||
|
||||
if (item.AlbumArtist) {
|
||||
|
||||
html += '<td class="tabletColumn"><a href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + '">' + item.AlbumArtist + '</a></td>';
|
||||
|
||||
} else {
|
||||
html += '<td class="tabletColumn"></td>';
|
||||
}
|
||||
}
|
||||
|
||||
if (options.showArtist) {
|
||||
|
||||
if (item.Artists && item.Artists.length) {
|
||||
|
@ -451,6 +440,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (options.showArtist) {
|
||||
|
||||
if (item.AlbumArtist) {
|
||||
|
||||
html += '<td class="tabletColumn">' + LibraryBrowser.getArtistLinksHtml([item.AlbumArtist]) + '</td>';
|
||||
|
||||
} else {
|
||||
html += '<td class="tabletColumn"></td>';
|
||||
}
|
||||
}
|
||||
|
||||
var time = Dashboard.getDisplayTime(item.RunTimeTicks || 0);
|
||||
|
||||
html += '<td class="tabletColumn">' + time + '</td>';
|
||||
|
|
|
@ -1 +1,140 @@
|
|||
|
||||
(function ($, document, apiClient) {
|
||||
|
||||
function formatDigit(i) {
|
||||
return i < 10 ? "0" + i : i;
|
||||
}
|
||||
|
||||
function getDateFormat(date) {
|
||||
|
||||
// yyyyMMddHHmmss
|
||||
// Convert to UTC
|
||||
// http://stackoverflow.com/questions/948532/how-do-you-convert-a-javascript-date-to-utc/14610512#14610512
|
||||
var d = new Date(date.getTime());
|
||||
|
||||
return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds());
|
||||
}
|
||||
|
||||
function normalizeDateToTimeslot(date) {
|
||||
|
||||
var minutesOffset = date.getMinutes() - 30;
|
||||
|
||||
if (minutesOffset >= 0) {
|
||||
|
||||
date.setTime(date.getTime() - (minutesOffset * 60 * 1000));
|
||||
|
||||
} else {
|
||||
|
||||
date.setTime(date.getTime() - (date.getMinutes() * 60 * 1000));
|
||||
}
|
||||
|
||||
date.setTime(date.getTime() - (date.getSeconds() * 1000));
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
var currentDate;
|
||||
var channelsPromise;
|
||||
|
||||
function reloadGuide(page) {
|
||||
|
||||
channelsPromise = channelsPromise || apiClient.getLiveTvChannels({
|
||||
|
||||
userId: Dashboard.getCurrentUserId()
|
||||
|
||||
});;
|
||||
|
||||
var date = currentDate;
|
||||
|
||||
var nextDay = new Date(date.getTime());
|
||||
nextDay.setDate(nextDay.getDate() + 1);
|
||||
nextDay.setHours(1, 0, 0, 0);
|
||||
|
||||
var promise1 = channelsPromise;
|
||||
var promise2 = apiClient.getLiveTvPrograms({
|
||||
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
MaxEndDate: getDateFormat(nextDay)
|
||||
|
||||
});
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
||||
var channels = response1[0].Items;
|
||||
var programs = response2[0].Items;
|
||||
|
||||
renderGuide(page, date, channels, programs);
|
||||
});
|
||||
}
|
||||
|
||||
function renderDate(page, date) {
|
||||
|
||||
$('.guideDate', page).html(LibraryBrowser.getFutureDateText(date));
|
||||
|
||||
$('.timeslotHeaders', page).html(getTimeslotHeadersHtml(date));
|
||||
}
|
||||
|
||||
function getTimeslotHeadersHtml(date) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div class="timeslotHeader channelTimeslotHeader"> </div>';
|
||||
|
||||
date = new Date(date.getTime());
|
||||
var dateNumber = date.getDate();
|
||||
|
||||
while (date.getDate() == dateNumber) {
|
||||
|
||||
html += '<div class="timeslotHeader">';
|
||||
html += LiveTvHelpers.getDisplayTime(date);
|
||||
html += '</div>';
|
||||
|
||||
// Add 30 mins
|
||||
date.setTime(date.getTime() + (30 * 60 * 1000));
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function getChannelHtml(page, date, channel, programs) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div class="guideChannel">';
|
||||
|
||||
html += '<div class="timeslotCell channelTimeslotCell">';
|
||||
html += channel.Name + '<br/>' + channel.Number;
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function renderChannels(page, date, channels, programs) {
|
||||
|
||||
var html = [];
|
||||
|
||||
for (var i = 0, length = channels.length; i < length; i++) {
|
||||
|
||||
html.push(getChannelHtml(page, date, channels[i], programs));
|
||||
}
|
||||
|
||||
$('#guide', page).html(html.join(''));
|
||||
}
|
||||
|
||||
function renderGuide(page, date, channels, programs) {
|
||||
|
||||
renderDate(page, date);
|
||||
renderChannels(page, date, channels, programs);
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#liveTvGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
currentDate = normalizeDateToTimeslot(new Date());
|
||||
|
||||
reloadGuide(page);
|
||||
});
|
||||
|
||||
})(jQuery, document, ApiClient);
|
|
@ -10,8 +10,9 @@
|
|||
html += '<th></th>';
|
||||
html += '<th>Name</th>';
|
||||
html += '<th>Album</th>';
|
||||
html += '<th>Artist</th>';
|
||||
html += '<th>Album Artist</th>';
|
||||
html += '<th>Time</th>';
|
||||
html += '<th>Rating</th>';
|
||||
html += '</tr></thead>';
|
||||
|
||||
html += '<tbody>';
|
||||
|
@ -20,14 +21,32 @@
|
|||
|
||||
var name = LibraryBrowser.getPosterViewDisplayName(item);
|
||||
|
||||
var parentName = item.SeriesName || item.Album || item.ProductionYear || '';
|
||||
var parentName = item.SeriesName || item.Album;
|
||||
|
||||
html += '<tr>';
|
||||
html += '<td><button type="button" data-index="' + i + '" class="lnkPlay" data-icon="play" data-iconpos="notext">Play</button></td>';
|
||||
html += '<td>' + name + '</td>';
|
||||
html += '<td>' + parentName + '</td>';
|
||||
html += '<td>';
|
||||
html += '<a href="itemdetails.html?id=' + item.Id + '">' + name + '</a>';
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
if (parentName) {
|
||||
var parentId = item.AlbumId || item.SeriesId || item.ParentId;
|
||||
html += '<a href="itemdetails.html?id=' + parentId + '">' + parentName + '</a>';
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
html += LibraryBrowser.getArtistLinksHtml(item.Artists || []);
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
if (item.AlbumArtist) {
|
||||
html += LibraryBrowser.getArtistLinksHtml([item.AlbumArtist]);
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>' + Dashboard.getDisplayTime(item.RunTimeTicks) + '</td>';
|
||||
html += '<td>' + LibraryBrowser.getUserDataIconsHtml(item) + '</td>';
|
||||
html += '<td><button type="button" data-index="' + i + '" class="lnkRemove" data-icon="delete" data-iconpos="notext">Remove</button></td>';
|
||||
html += '</tr>';
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue