added dvdlib for better dvd runtimes

This commit is contained in:
Luke Pulverenti 2014-01-11 00:49:18 -05:00
parent 8ef09d054d
commit 02cd9ef7f7
12 changed files with 197 additions and 168 deletions

View File

@ -1594,9 +1594,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
if (itemType == "Artist") { if (itemType == "Artist") {
url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images"); url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images");
} }
else if (itemType == "Channel") {
url = self.getUrl("LiveTv/Channels/" + itemId + "/Images");
}
else if (itemType == "Genre") { else if (itemType == "Genre") {
url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images"); url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images");
} else if (itemType == "GameGenre") { } else if (itemType == "GameGenre") {
@ -1667,9 +1664,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
if (itemType == "Artist") { if (itemType == "Artist") {
url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images/" + imageType + "/" + imageIndex + "/Index", options); url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images/" + imageType + "/" + imageIndex + "/Index", options);
} }
else if (itemType == "Channel") {
url = self.getUrl("LiveTv/Channels/" + itemId + "/Images/" + imageType + "/" + imageIndex + "/Index", options);
}
else if (itemType == "Genre") { else if (itemType == "Genre") {
url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images/" + imageType + "/" + imageIndex + "/Index", options); url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images/" + imageType + "/" + imageIndex + "/Index", options);
} else if (itemType == "GameGenre") { } else if (itemType == "GameGenre") {
@ -1701,9 +1695,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
if (itemType == "Artist") { if (itemType == "Artist") {
url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images"); url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images");
} }
else if (itemType == "Channel") {
url = self.getUrl("LiveTv/Channels/" + itemId + "/Images");
}
else if (itemType == "Genre") { else if (itemType == "Genre") {
url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images"); url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images");
} else if (itemType == "GameGenre") { } else if (itemType == "GameGenre") {
@ -1838,9 +1829,6 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
if (itemType == "Artist") { if (itemType == "Artist") {
url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images"); url = self.getUrl("Artists/" + self.encodeName(itemName) + "/Images");
} }
else if (itemType == "Channel") {
url = self.getUrl("LiveTv/Channels/" + itemId + "/Images");
}
else if (itemType == "Genre") { else if (itemType == "Genre") {
url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images"); url = self.getUrl("Genres/" + self.encodeName(itemName) + "/Images");
} else if (itemType == "GameGenre") { } else if (itemType == "GameGenre") {

View File

@ -156,9 +156,9 @@
} }
.detailButtonsContainer { .detailButtonsContainer {
padding: .75em 0 .75em; padding: .5em 0 .5em;
text-align: center; text-align: center;
border-top: 1px solid #444; border-top: 1px solid #333;
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
} }

View File

@ -133,12 +133,12 @@
.channelTimeslotHeader { .channelTimeslotHeader {
position: absolute; position: absolute;
left: 15px; left: 10px;
} }
.timeslotHeaders { .timeslotHeaders {
position: absolute; position: absolute;
right: 28px; right: 13px;
overflow-y: hidden; overflow-y: hidden;
overflow-x: hidden; overflow-x: hidden;
white-space: nowrap; white-space: nowrap;
@ -146,7 +146,7 @@
.channelPrograms { .channelPrograms {
white-space: nowrap; white-space: nowrap;
height: 47px; height: 53px;
} }
.timeslotHeader { .timeslotHeader {
@ -197,7 +197,7 @@
position: relative; position: relative;
} }
.channelHeaderCellInner:hover { .channelHeaderCell:hover {
background-color: #38c; background-color: #38c;
} }
@ -205,14 +205,14 @@
overflow-y: hidden; overflow-y: hidden;
overflow-x: hidden; overflow-x: hidden;
position: absolute; position: absolute;
left: 15px; left: 10px;
bottom: 46px; bottom: 46px;
} }
.programGrid { .programGrid {
position: absolute; position: absolute;
bottom: 30px; bottom: 30px;
right: 15px; right: 0;
overflow-y: scroll; overflow-y: scroll;
overflow-x: scroll; overflow-x: scroll;
} }
@ -242,7 +242,7 @@
} }
.timeslotHeaders, .programGrid { .timeslotHeaders, .programGrid {
left: 206px; left: 201px;
} }
.channelTimeslotHeader, .timeslotHeaders { .channelTimeslotHeader, .timeslotHeaders {
@ -254,11 +254,12 @@
} }
.channelHeaderCell, .timeslotCell { .channelHeaderCell, .timeslotCell {
height: 46px; height: 52px;
} }
.guideProgramName { .guideProgramName {
padding: .35em .5em; padding: .35em .5em;
font-size: 14px;
} }
.guideProgramTime { .guideProgramTime {
@ -301,14 +302,3 @@
display: none !important; display: none !important;
} }
} }
/* Account for hidden navigation */
@media (max-width: 750px) {
.channelTimeslotHeader, .timeslotHeaders {
top: 115px;
}
.channelList, .programGrid {
top: 145px;
}
}

View File

@ -14,7 +14,7 @@
<a href="livetvseriestimers.html" class="ui-btn-active">Series</a> <a href="livetvseriestimers.html" class="ui-btn-active">Series</a>
</div> </div>
<div data-role="content"> <div data-role="content">
<div style="max-width: 700px; margin: 0 auto;"> <div style="max-width: 600px; margin: 0 auto;">
<div id="items"></div> <div id="items"></div>
</div> </div>
</div> </div>

View File

@ -14,7 +14,7 @@
<a href="livetvseriestimers.html">Series</a> <a href="livetvseriestimers.html">Series</a>
</div> </div>
<div data-role="content"> <div data-role="content">
<div style="max-width: 900px; margin: 0 auto;"> <div style="max-width: 600px; margin: 0 auto;">
<div id="items"></div> <div id="items"></div>
</div> </div>
</div> </div>

View File

@ -779,22 +779,12 @@
height = 400; height = 400;
width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null; width = primaryImageAspectRatio ? Math.round(height * primaryImageAspectRatio) : null;
if (item.Type == "Recording") {
imgUrl = ApiClient.getUrl("LiveTV/Recordings/" + item.Id + "/Images/Primary", {
type: "Primary",
height: height,
width: width,
tag: item.ImageTags.Primary
});
} else {
imgUrl = ApiClient.getImageUrl(item.Id, { imgUrl = ApiClient.getImageUrl(item.Id, {
type: "Primary", type: "Primary",
height: height, height: height,
width: width, width: width,
tag: item.ImageTags.Primary tag: item.ImageTags.Primary
}); });
}
} }
else if (item.AlbumId && item.AlbumPrimaryImageTag) { else if (item.AlbumId && item.AlbumPrimaryImageTag) {
@ -1784,28 +1774,7 @@
if (imageTags.Primary) { if (imageTags.Primary) {
if (item.Type == "Channel") { if (item.Type == "Person") {
url = ApiClient.getUrl("LiveTV/Channels/" + item.Id + "/Images/Primary", {
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "Recording") {
url = ApiClient.getUrl("LiveTV/Recordings/" + item.Id + "/Images/Primary", {
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "Program") {
url = ApiClient.getUrl("LiveTV/Programs/" + item.Id + "/Images/Primary", {
maxheight: imageHeight,
tag: imageTags.Primary,
type: "Primary"
});
}
else if (item.Type == "Person") {
url = ApiClient.getPersonImageUrl(item.Name, { url = ApiClient.getPersonImageUrl(item.Name, {
maxheight: imageHeight, maxheight: imageHeight,
tag: imageTags.Primary, tag: imageTags.Primary,

View File

@ -50,7 +50,7 @@
var nextDay = new Date(date.getTime()); var nextDay = new Date(date.getTime());
nextDay.setHours(0, 0, 0, 0); nextDay.setHours(0, 0, 0, 0);
nextDay.setDate(nextDay.getDate() + 1); nextDay.setDate(nextDay.getDate() + 1);
console.log(nextDay);
channelsPromise.done(function(channelsResult) { channelsPromise.done(function(channelsResult) {
apiClient.getLiveTvPrograms({ apiClient.getLiveTvPrograms({
@ -311,7 +311,7 @@
html.push(getChannelProgramsHtml(page, date, channels[i], programs)); html.push(getChannelProgramsHtml(page, date, channels[i], programs));
} }
$('.programGrid', page).html(html.join('')); $('.programGrid', page).html(html.join('')).scrollTop(0).scrollLeft(0);
} }
function renderChannelHeaders(page, channels) { function renderChannelHeaders(page, channels) {
@ -331,7 +331,7 @@
if (channel.ImageTags.Primary) { if (channel.ImageTags.Primary) {
var url = ApiClient.getUrl("LiveTV/Channels/" + channel.Id + "/Images/Primary", { var url = ApiClient.getImageUrl(channel.Id, {
maxheight: 200, maxheight: 200,
maxwidth: 200, maxwidth: 200,
tag: channel.ImageTags.Primary, tag: channel.ImageTags.Primary,

View File

@ -139,38 +139,59 @@
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">'; html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
var index = '';
for (var i = 0, length = timers.length; i < length; i++) { for (var i = 0, length = timers.length; i < length; i++) {
var timer = timers[i]; var timer = timers[i];
var programInfo = timer.ProgramInfo || {}; var startDateText = LibraryBrowser.getFutureDateText(parseISO8601Date(timer.StartDate, { toLocal: true }));
if (startDateText != index) {
html += '<li data-role="list-divider">' + startDateText + '</li>';
index = startDateText;
}
html += '<li><a href="livetvtimer.html?id=' + timer.Id + '">'; html += '<li><a href="livetvtimer.html?id=' + timer.Id + '">';
html += '<h3>'; var program = timer.ProgramInfo;
html += (programInfo.EpisodeTitle || timer.Name); var imgUrl;
html += '</h3>';
var startDate = timer.StartDate; if (program.ImageTags && program.ImageTags.Primary) {
try {
startDate = parseISO8601Date(startDate, { toLocal: true });
} catch (err) {
imgUrl = ApiClient.getImageUrl(program.Id, {
height: 160,
tag: program.ImageTags.Primary,
type: "Primary"
});
} else {
imgUrl = "css/images/items/searchhintsv2/tv.png";
} }
html += '<p>' + startDate.toLocaleDateString() + '</p>'; html += '<img src="css/images/items/searchhintsv2/tv.png" style="display:none;">';
html += '<div class="ui-li-thumb" style="background-image:url(\'' + imgUrl + '\');width:5em;height:5em;background-repeat:no-repeat;background-position:center center;background-size: cover;"></div>';
html += '<h3>';
html += program.EpisodeTitle || timer.Name;
if (program.IsRepeat) {
html += ' (R)';
}
html += '</h3>';
html += '<p>'; html += '<p>';
html += LiveTvHelpers.getDisplayTime(timer.StartDate); html += LiveTvHelpers.getDisplayTime(timer.StartDate);
html += ' - ' + LiveTvHelpers.getDisplayTime(timer.EndDate);
if (timer.ChannelName) {
html += ' on ' + timer.ChannelName;
}
html += '</p>'; html += '</p>';
if (timer.SeriesTimerId) {
html += '<div class="ui-li-aside" style="right:0;">';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '</div>';
}
html += '</a>'; html += '</a>';
html += '<a data-timerid="' + timer.Id + '" href="#" title="Cancel Recording" class="btnCancelTimer">Cancel Recording</a>'; html += '<a data-timerid="' + timer.Id + '" href="#" title="Cancel Recording" class="btnCancelTimer">Cancel Recording</a>';

View File

@ -43,7 +43,7 @@
if (programInfo.ImageTags && programInfo.ImageTags.Primary) { if (programInfo.ImageTags && programInfo.ImageTags.Primary) {
var imgUrl = ApiClient.getUrl("LiveTV/Programs/" + programInfo.Id + "/Images/Primary", { var imgUrl = ApiClient.getImageUrl(programInfo.Id, {
maxwidth: 200, maxwidth: 200,
maxheight: 200, maxheight: 200,
tag: programInfo.ImageTags.Primary, tag: programInfo.ImageTags.Primary,

View File

@ -23,98 +23,159 @@
var html = ''; var html = '';
var cssClass = "detailTable"; html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
html += '<div class="detailTableContainer"><table class="detailTable" >'; var index = '';
html += '<thead>';
html += '<tr>';
html += '<th class="tabletColumn">&nbsp;</th>';
html += '<th>Name</th>';
html += '<th class="desktopColumn">Channel</th>';
html += '<th>Date</th>';
html += '<th>Time</th>';
html += '<th class="tabletColumn">Length</th>';
html += '<th class="tabletColumn">Status</th>';
html += '<th class="desktopColumn">Series</th>';
html += '</tr>';
html += '</thead>';
html += '<tbody>';
for (var i = 0, length = timers.length; i < length; i++) { for (var i = 0, length = timers.length; i < length; i++) {
var timer = timers[i]; var timer = timers[i];
html += '<tr>'; var startDateText = LibraryBrowser.getFutureDateText(parseISO8601Date(timer.StartDate, { toLocal: true }));
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">Cancel</button>';
html += '</td>';
html += '<td>';
html += '<a href="livetvtimer.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;
try {
startDate = parseISO8601Date(startDate, { toLocal: true });
} catch (err) {
if (startDateText != index) {
html += '<li data-role="list-divider">' + startDateText + '</li>';
index = startDateText;
} }
html += '<td>' + startDate.toLocaleDateString() + '</td>'; html += '<li><a href="livetvtimer.html?id=' + timer.Id + '">';
html += '<td>' + LiveTvHelpers.getDisplayTime(timer.StartDate) + '</td>'; var program = timer.ProgramInfo;
var imgUrl;
var minutes = timer.RunTimeTicks / 600000000; if (program.ImageTags && program.ImageTags.Primary) {
minutes = minutes || 1;
html += '<td class="tabletColumn">' + Math.round(minutes) + 'min</td>';
html += '<td class="tabletColumn">';
if (timer.Status == 'ConflictedNotOk' || timer.Status == 'Error') {
html += '<span style="color:red;">';
html += timer.Status;
html += '</span>';
imgUrl = ApiClient.getImageUrl(program.Id, {
height: 160,
tag: program.ImageTags.Primary,
type: "Primary"
});
} else { } else {
html += timer.Status; imgUrl = "css/images/items/searchhintsv2/tv.png";
} }
html += '</td>'; html += '<img src="css/images/items/searchhintsv2/tv.png" style="display:none;">';
html += '<div class="ui-li-thumb" style="background-image:url(\'' + imgUrl + '\');width:5em;height:5em;background-repeat:no-repeat;background-position:center center;background-size: cover;"></div>';
html += '<h3>';
html += timer.Name;
html += '</h3>';
html += '<p>';
html += LiveTvHelpers.getDisplayTime(timer.StartDate);
html += ' - ' + LiveTvHelpers.getDisplayTime(timer.EndDate);
html += '</p>';
html += '<td class="desktopColumn">';
if (timer.SeriesTimerId) { if (timer.SeriesTimerId) {
html += '<a href="livetvseriestimer.html?id=' + timer.SeriesTimerId + '" title="View Series Recording">'; html += '<div class="ui-li-aside" style="right:0;">';
html += '<div class="timerCircle seriesTimerCircle"></div>'; html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>'; html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '<div class="timerCircle seriesTimerCircle"></div>'; html += '<div class="timerCircle seriesTimerCircle"></div>';
html += '</div>';
}
html += '</a>'; html += '</a>';
html += '<a data-timerid="' + timer.Id + '" href="#" title="Cancel Recording" class="btnDeleteTimer">Cancel Recording</a>';
html += '</li>';
} }
html += '</td>'; html += '</ul>';
html += '</tr>'; //var cssClass = "detailTable";
}
html += '</tbody>'; //html += '<div class="detailTableContainer"><table class="detailTable" >';
html += '</table></div>';
//html += '<thead>';
//html += '<tr>';
//html += '<th class="tabletColumn">&nbsp;</th>';
//html += '<th>Name</th>';
//html += '<th class="desktopColumn">Channel</th>';
//html += '<th>Date</th>';
//html += '<th>Time</th>';
//html += '<th class="tabletColumn">Length</th>';
//html += '<th class="tabletColumn">Status</th>';
//html += '<th class="desktopColumn">Series</th>';
//html += '</tr>';
//html += '</thead>';
//html += '<tbody>';
//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">Cancel</button>';
// html += '</td>';
// html += '<td>';
// html += '<a href="livetvtimer.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;
// try {
// startDate = parseISO8601Date(startDate, { toLocal: true });
// } catch (err) {
// }
// html += '<td>' + startDate.toLocaleDateString() + '</td>';
// html += '<td>' + LiveTvHelpers.getDisplayTime(timer.StartDate) + '</td>';
// var minutes = timer.RunTimeTicks / 600000000;
// minutes = minutes || 1;
// html += '<td class="tabletColumn">' + Math.round(minutes) + 'min</td>';
// html += '<td class="tabletColumn">';
// if (timer.Status == 'ConflictedNotOk' || timer.Status == 'Error') {
// html += '<span style="color:red;">';
// html += timer.Status;
// html += '</span>';
// } else {
// html += timer.Status;
// }
// html += '</td>';
// html += '<td class="desktopColumn">';
// if (timer.SeriesTimerId) {
// html += '<a href="livetvseriestimer.html?id=' + timer.SeriesTimerId + '" title="View Series Recording">';
// html += '<div class="timerCircle seriesTimerCircle"></div>';
// html += '<div class="timerCircle seriesTimerCircle"></div>';
// html += '<div class="timerCircle seriesTimerCircle"></div>';
// html += '</a>';
// }
// html += '</td>';
// html += '</tr>';
//}
//html += '</tbody>';
//html += '</table></div>';
var elem = $('#items', page).html(html).trigger('create'); var elem = $('#items', page).html(html).trigger('create');

View File

@ -1910,7 +1910,7 @@
if (channel.ImageTags.Primary) { if (channel.ImageTags.Primary) {
imgUrl = ApiClient.getUrl("LiveTV/Channels/" + channel.Id + "/Images/Primary", { imgUrl = ApiClient.getImageUrl(channel.Id, {
maxwidth: 200, maxwidth: 200,
tag: channel.ImageTags.Primary, tag: channel.ImageTags.Primary,
type: "Primary" type: "Primary"

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.223" targetFramework="net45" /> <package id="MediaBrowser.ApiClient.Javascript" version="3.0.224" targetFramework="net45" />
</packages> </packages>