live tv + nuget updates

This commit is contained in:
Luke Pulverenti 2013-12-15 09:19:24 -05:00
parent b2b7584352
commit f0a64f2f2e
4 changed files with 112 additions and 46 deletions

View File

@ -14,31 +14,55 @@
</div>
<div data-role="content">
<form id="liveTvSeriesTimerForm" style="margin: 0 auto;">
<p><span class="itemName inlineItemName"></span><span class="itemMiscInfo" style="display: inline;"></span></p>
<p><span class="itemName inlineItemName"></span></p>
<p class="channel"></p>
<p class="overview"></p>
<p style="margin-top: 2em;">
<p>
<a id="btnCancelTimer" href="#">Cancel Series</a>
</p>
<br />
<p class="channel" style="margin-top: 2em;"></p>
<p class="time"></p>
<p class="overview"></p>
<br />
<ul data-role="listview" class="ulForm">
<li>
<label for="selectPriority">Priority: </label>
<select id="selectPriority" required="required" data-mini="true">
<option value="0">Highest</option>
<option value="1">Higher</option>
<option value="2">High</option>
<option value="3">Medium</option>
<option value="4">Low</option>
<option value="5">Lower</option>
<option value="6">Lowest</option>
<label for="selectSeriesType">Series type: </label>
<select id="selectSeriesType" required="required" data-mini="true" disabled="disabled">
<option value="Manual">Manual</option>
<option value="NewProgramEventsOneChannel">New episodes, one channel</option>
<option value="NewProgramEventsAllChannels">New episodes, all channels</option>
<option value="AllProgramEventsOneChannel">All episodes, one channel</option>
<option value="AllProgramEventsAllChannels">All episodes, all channels</option>
</select>
</li>
<li id="fldDays" style="display: none;">
<h3>Days</h3>
<div data-role="controlgroup">
<input type="checkbox" data-mini="true" id="chkSunday" />
<label for="chkSunday">Sunday</label>
<input type="checkbox" data-mini="true" id="chkMonday" />
<label for="chkMonday">Monday</label>
<input type="checkbox" data-mini="true" id="chkTuesday" />
<label for="chkTuesday">Tuesday</label>
<input type="checkbox" data-mini="true" id="chkWednesday" />
<label for="chkWednesday">Wednesday</label>
<input type="checkbox" data-mini="true" id="chkThursday" />
<label for="chkThursday">Thursday</label>
<input type="checkbox" data-mini="true" id="chkFriday" />
<label for="chkFriday">Friday</label>
<input type="checkbox" data-mini="true" id="chkSaturday" />
<label for="chkSaturday">Saturday</label>
</div>
</li>
<li>
<label for="txtRequestedPrePaddingSeconds">Requested pre-padding seconds: </label>
<input type="number" id="txtRequestedPrePaddingSeconds" pattern="[0-9]*" required="required" min="0" data-mini="true" />

View File

@ -75,7 +75,7 @@
header: "Select Server Cache Path",
instruction: "Browse or enter the path to use for Media Browser Server cache. The folder must be writeable."
instruction: "Browse or enter the path to use for Media Browser Server cache. The folder must be writeable. The location of this folder will directly impact server performance and should ideally be placed on a solid state drive."
});
});

View File

@ -26,20 +26,67 @@
currentItem = item;
$('.itemName', page).html(item.Name);
$('.channel', page).html('<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>').trigger('create');
$('.overview', page).html(item.Overview || '');
$('#txtRequestedPrePaddingSeconds', page).val(item.RequestedPrePaddingSeconds);
$('#txtRequestedPostPaddingSeconds', page).val(item.RequestedPostPaddingSeconds);
$('#txtRequiredPrePaddingSeconds', page).val(item.RequiredPrePaddingSeconds);
$('#txtRequiredPostPaddingSeconds', page).val(item.RequiredPostPaddingSeconds);
$('#selectPriority', page).val(item.Priority);
$('.itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
var channelHtml = '';
if (item.RecurrenceType == 'NewProgramEventsAllChannels' || item.RecurrenceType == 'AllProgramEventsAllChannels') {
channelHtml += 'All Channels';
}
else if (item.ChannelId) {
channelHtml += '<a href="livetvchannel.html?id=' + item.ChannelId + '">' + item.ChannelName + '</a>';
}
$('.channel', page).html('Channel:&nbsp;&nbsp;&nbsp;' + channelHtml).trigger('create');
$('#selectSeriesType', page).val(item.RecurrenceType).selectmenu('refresh').trigger('change');
selectDays(page, item.Days);
$('.time', page).html('Time:&nbsp;&nbsp;&nbsp;' + LiveTvHelpers.getDisplayTime(item.StartDate));
Dashboard.hideLoadingMsg();
}
function selectDays(page, days) {
var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
for (var i = 0, length = daysOfWeek.length; i < length; i++) {
var day = daysOfWeek[i];
$('#chk' + day, page).checked(days.indexOf(day) != -1).checkboxradio('refresh');
}
}
function getDays(page) {
var daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
var days = [];
for (var i = 0, length = daysOfWeek.length; i < length; i++) {
var day = daysOfWeek[i];
if ($('#chk' + day, page).checked()) {
days.push(day);
}
}
return days;
}
function onSubmit() {
Dashboard.showLoadingMsg();
@ -52,7 +99,9 @@
item.RequestedPostPaddingSeconds = $('#txtRequestedPostPaddingSeconds', form).val();
item.RequiredPrePaddingSeconds = $('#txtRequiredPrePaddingSeconds', form).val();
item.RequiredPostPaddingSeconds = $('#txtRequiredPostPaddingSeconds', form).val();
item.Priority = $('#selectPriority', form).val();
item.RecurrenceType = $('#selectSeriesType', form).val();
item.Days = getDays(form);
ApiClient.updateLiveTvSeriesTimer(item).done(function () {
Dashboard.alert('Timer Saved');
@ -70,7 +119,7 @@
var id = getParameterByName('id');
apiClient.getLiveTvTimer(id).done(function (result) {
apiClient.getLiveTvSeriesTimer(id).done(function (result) {
renderTimer(page, result);
@ -87,6 +136,16 @@
});
$('#selectSeriesType', page).on('change', function () {
if (this.value == 'Manual') {
$('#fldDays', page).show();
} else {
$('#fldDays', page).hide();
}
});
}).on('pagebeforeshow', "#liveTvSeriesTimerPage", function () {
var page = this;

View File

@ -32,9 +32,8 @@
html += '<th class="tabletColumn">&nbsp;</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 += '<th class="tabletColumn">Time</th>';
html += '</tr>';
@ -53,33 +52,15 @@
html += '</td>';
html += '<td class="desktopColumn">';
if (timer.ChannelId) {
if (timer.RecurrenceType == 'NewProgramEventsAllChannels' || timer.RecurrenceType == 'AllProgramEventsAllChannels') {
html += 'All Channels';
}
else 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) {
@ -93,6 +74,8 @@
html += '</td>';
html += '<td class="tabletColumn">' + LiveTvHelpers.getDisplayTime(timer.StartDate) + '</td>';
html += '</tr>';
}