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

add more methods to file system interface

This commit is contained in:
Luke Pulverenti 2014-01-01 13:26:31 -05:00
parent 2861ff68c9
commit 7743b36bc9
46 changed files with 421 additions and 504 deletions

View file

@ -872,6 +872,47 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
/**
* Gets shares from a network device
*/
self.getNetworkShares = function (path) {
if (!path) {
throw new Error("null path");
}
var options = {};
options.path = path;
var url = self.getUrl("Environment/NetworkShares", options);
return self.ajax({
type: "GET",
url: url,
dataType: "json"
});
};
/**
* Gets the parent of a given path
*/
self.getParentPath = function (path) {
if (!path) {
throw new Error("null path");
}
var options = {};
options.path = path;
var url = self.getUrl("Environment/ParentPath", options);
return self.ajax({
type: "GET",
url: url
});
};
/**
* Gets a list of physical drives from the server
*/

View file

@ -27,14 +27,14 @@
.detailTable td {
border-spacing: 0;
border-top: 1px solid #444;
border-bottom: 1px solid #444;
border-top: 1px solid #404040;
border-bottom: 1px solid #404040;
padding: 5px 5px;
}
.detailTable th {
border-spacing: 0;
border-bottom: 1px solid #444;
border-bottom: 1px solid #404040;
padding: 5px;
font-weight: bold;
text-align: left;
@ -73,3 +73,9 @@
display: table-cell;
}
}
.detailTable tbody tr:nth-child(odd) td,
.detailTable tbody tr:nth-child(odd) th {
background-color: #eeeeee; /* non-RGBA fallback */
background-color: rgba(0,0,0,.1);
}

View file

@ -363,12 +363,14 @@ a.itemTag:hover {
}
.noBackdrop {
height: 280px;
height: auto;
border: 0;
}
.noBackdrop .itemBackdropContent {
background-color: transparent;
position: static;
margin-top: 1em;
}
.lnkSibling {
@ -435,13 +437,6 @@ a.itemTag:hover {
font-weight: normal!important;
}
.itemBackdrop .parentName {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.inlineItemName {
font-size: 22px;
}
@ -451,8 +446,8 @@ a.itemTag:hover {
}
.itemOverview {
max-height: 70px;
overflow-y: auto;
/*max-height: 120px;
overflow-y: auto;*/
text-overflow: ellipsis;
}
@ -615,10 +610,6 @@ a.itemTag:hover {
height: auto;
}
.noBackdrop {
height: auto;
}
.itemBackdropContent {
position: static;
padding: 1em 1em 0;
@ -836,8 +827,8 @@ a.itemTag:hover {
right: 5px;
text-align: center;
vertical-align: middle;
width: 28px;
height: 23px;
width: 26px;
height: 21px;
padding-top: 5px;
border-radius: 50%;
color: #fff;
@ -970,8 +961,7 @@ a.itemTag:hover {
.alphabetPicker {
position: fixed;
right: 2px;
bottom: 0;
top: 100px;
bottom: 30px;
width: 27px;
z-index: 1000;
text-align: center;
@ -984,7 +974,7 @@ a.itemTag:hover {
display: block;
text-decoration: none;
padding: 1px 0;
color: #eee!important;
color: #bbb!important;
}
.alphabetPicker a:hover:not(.selectedCharacter) {
@ -1008,35 +998,31 @@ a.itemTag:hover {
}
}
@media all and (min-height: 600px) {
@media all and (min-height: 800px) {
.alphabetPicker a {
padding: 2px 0;
padding: 5px 0;
}
}
@media all and (min-height: 720px) {
@media all and (min-height: 900px) {
.alphabetPicker {
top: 135px;
}
.alphabetPicker a {
padding: 4px 0;
bottom: 120px;
}
}
@media all and (min-height: 850px) {
@media all and (min-height: 1000px) {
.alphabetPicker a {
padding: 6px 0;
.alphabetPicker {
bottom: 200px;
}
}
.viewCollageImage {
display: inline-block;
margin: 0 1px 0 0;
width: 32.6%;
width: 32.62%;
height: 49%;
background-repeat: no-repeat;
background-position: center 15%;
@ -1046,7 +1032,7 @@ a.itemTag:hover {
@media all and (min-width: 650px) {
.viewCollageImage {
width: 32.8%;
width: 32.9%;
height: 49.1%;
}
}
@ -1054,6 +1040,6 @@ a.itemTag:hover {
@media all and (min-width: 1440px) {
.viewCollageImage {
width: 32.9%;
width: 32.95%;
}
}

View file

@ -198,7 +198,7 @@ input[type="range"]::-ms-fill-upper {
border: 1px solid #999;
position: absolute;
z-index: 99999;
bottom: 55px;
bottom: 80px;
margin-left: -50px;
max-height: 300px;
overflow-y: auto;

View file

@ -7,7 +7,6 @@
color: #fff!important;
text-decoration: none;
text-align: left;
overflow: hidden;
-webkit-transition: all 500ms ease;
-moz-transition: all 500ms ease;
-o-transition: all 500ms ease;
@ -15,15 +14,9 @@
transition: all 500ms ease;
}
.posterItem:hover {
-moz-box-shadow: 0 0 15px 8px #2572EB;
-webkit-box-shadow: 0 0 25px 8px #2572EB;
box-shadow: 0 0 15px 8px #2572EB;
}
.smallBackdropPosterItem, .smallPosterItem {
margin: 3px;
margin: 5px;
}
.posterItemImage {
@ -31,10 +24,20 @@
background-repeat: no-repeat;
background-position: center bottom;
background-color: #000;
border: 2px solid #202020;
position: relative;
}
.posterItem:hover .posterItemImage {
-moz-box-shadow: 0 0 12px 7px #2572EB;
-webkit-box-shadow: 0 0 12px 7px #2572EB;
box-shadow: 0 0 12px 7px #2572EB;
}
.coveredPosterItemImage {
background-size: cover;
background-position: center center;
}
.transparentPosterItem .posterItemImage {
background-color: transparent;
}
@ -117,7 +120,7 @@
}
.squarePosterItem .posterItemImage {
height: 138px;
height: 142px;
}
.storeReviewCount {
@ -130,7 +133,7 @@
}
.backdropPosterItem .posterItemImage {
height: 77.625px;
height: 79.875px;
}
.smallBackdropPosterItem {
@ -138,7 +141,7 @@
}
.smallBackdropPosterItem .posterItemImage {
height: 87.75px;
height: 90px;
}
.portraitPosterItem {
@ -146,7 +149,7 @@
}
.portraitPosterItem .posterItemImage {
height: 129px;
height: 135px;
}
.posterItemProgress .itemProgressBar {
@ -155,6 +158,16 @@
opacity: .6;
}
.miniPosterItemProgress {
/* Make sure it's on top of the fade gradient '*/
z-index: 10;
}
.miniPosterItemProgress .itemProgressBar {
height: 7px;
opacity: 1;
}
@media all and (min-width: 540px) {
.backdropPosterItem {
@ -162,11 +175,11 @@
}
.backdropPosterItem .posterItemImage {
height: 144px;
height: 146.25px;
}
.smallBackdropPosterItem {
width: 188px;
width: 184px;
}
.smallBackdropPosterItem .posterItemImage {
@ -182,7 +195,7 @@
}
.squarePosterItem .posterItemImage {
height: 160px;
height: 164px;
}
.portraitPosterItem {
@ -190,7 +203,7 @@
}
.portraitPosterItem .posterItemImage {
height: 177px;
height: 183px;
}
}
@ -201,7 +214,7 @@
}
.backdropPosterItem .posterItemImage {
height: 153px;
height: 155.25px;
}
.smallBackdropPosterItem {
@ -209,7 +222,7 @@
}
.smallBackdropPosterItem .posterItemImage {
height: 108px;
height: 110.25px;
}
}
@ -220,7 +233,7 @@
}
.portraitPosterItem .posterItemImage {
height: 162px;
height: 168px;
}
}
@ -231,7 +244,7 @@
}
.backdropPosterItem .posterItemImage {
height: 153px;
height: 155.25px;
}
.portraitPosterItem {
@ -239,7 +252,7 @@
}
.portraitPosterItem .posterItemImage {
height: 201px;
height: 207px;
}
.smallBackdropPosterItem {
@ -247,7 +260,7 @@
}
.smallBackdropPosterItem .posterItemImage {
height: 126px;
height: 128.25px;
}
.storeReviewCount {
@ -262,20 +275,7 @@
}
.squarePosterItem .posterItemImage {
height: 170px;
}
.portraitPosterItem {
width: 138px;
}
.portraitPosterItem .posterItemImage {
height: 201px;
}
.portraitPosterItem .itemProgressText {
display: inline;
height: 174px;
}
.backdropPosterItem {
@ -283,7 +283,7 @@
}
.backdropPosterItem .posterItemImage {
height: 162px;
height: 164.25px;
}
}
@ -294,7 +294,7 @@
}
.squarePosterItem .posterItemImage {
height: 200px;
height: 204px;
}
.portraitPosterItem {
@ -302,6 +302,6 @@
}
.portraitPosterItem .posterItemImage {
height: 240px;
height: 246px;
}
}

View file

@ -131,6 +131,10 @@
<p class="itemGenres"></p>
<p class="itemOverview desktopOverview"></p>
<p id="itemBirthday"></p>
<p id="itemBirthLocation"></p>
<p id="itemDeathDate"></p>
<p id="itemLinks"></p>
</td>
</tr>
</table>
@ -150,24 +154,7 @@
</div>
<div data-role="content">
<div class="detailPageContent">
<div id="detailSection" style="display: none;">
<div class="detailSectionHeader" style="margin-top: 0;">
Details
</div>
<div class="detailSectionContent" style="padding: 0 1em;">
<p id="itemBirthLocation"></p>
<p id="itemDeathDate"></p>
<p id="itemLinks"></p>
</div>
</div>
<br />
<div id="itemTabs" style="text-align: center;"></div>
</div>
<div id="itemTabs" style="text-align: center; margin: 1em 0;"></div>
<div class="viewSettings">
<div class="viewControls">
</div>

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Media Browser</title>
</head>
<body>
<div id="liveTvRecordingListPage" data-role="page" class="page libraryPage" data-theme="b" data-view="livetv">
<div class="libraryViewNav">
<a href="livetvguide.html">Guide</a>
<a href="livetvchannels.html">Channels</a>
<a href="livetvrecordings.html" class="ui-btn-active">Recordings</a>
<a href="livetvtimers.html">Scheduled</a>
<a href="livetvseriestimers.html">Series</a>
</div>
<div data-role="content">
<div class="viewSettings">
<div class="viewControls">
</div>
<div class="listTopPaging">
</div>
</div>
<div id="items" class="itemsContainer"></div>
</div>
</div>
</body>
</html>

View file

@ -16,13 +16,18 @@
<table class="ehsContent">
<tr>
<td>
<div id="activeRecordings" style="display: none;">
<h1 class="listHeader">Active Recordings</h1>
<div class="recordingItems"></div>
<br />
</div>
<div id="latestRecordings" style="display: none;">
<h1 class="listHeader">Latest Recordings</h1>
<div id="latestRecordingItems"></div>
</div>
<div class="recordingItems"></div>
<br />
</div>
<div id="recordingGroups" style="display: none;">
<h1 class="listHeader">All Recordings</h1>
<h1 class="listHeader">Recording Archive</h1>
<div id="recordingGroupItems"></div>
</div>
</td>

View file

@ -62,7 +62,7 @@
<input type="checkbox" id="chkAllChannels" data-mini="true" />
</li>
</ul>
<div data-role="collapsible" data-mini="true" data-content-theme="false">
<div data-role="collapsible" data-mini="true">
<h3>Pre/Post Padding</h3>
<div>
<br />

View file

@ -30,7 +30,7 @@
<br />
<div data-role="collapsible" data-mini="true" data-content-theme="false">
<div data-role="collapsible" data-mini="true">
<h3>Pre/Post Padding</h3>
<div>
<br />
@ -62,7 +62,7 @@
<ul data-role="listview" class="ulForm">
<li>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
<button type="submit" data-theme="a" data-icon="check" data-mini="true">
Save
</button>
<button type="button" onclick="Dashboard.navigate('livetvtimers.html');" data-icon="delete" data-mini="true">

View file

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

View file

@ -41,14 +41,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -12,16 +12,28 @@
var promise;
var parentPathPromise = null;
if (path === "Network") {
promise = ApiClient.getNetworkDevices();
}
else if (path) {
promise = ApiClient.getDirectoryContents(path, fileOptions);
parentPathPromise = ApiClient.getParentPath(path);
} else {
promise = ApiClient.getDrives();
}
promise.done(function (folders) {
if (!parentPathPromise) {
parentPathPromise = $.Deferred();
parentPathPromise.resolveWith(null, []);
parentPathPromise = parentPathPromise.promise();
}
$.when(promise, parentPathPromise).done(function (response1, response2) {
var folders = response1[0];
var parentPath = response2 && response2.length ? response2[0] || '' : '';
$('#txtDirectoryPickerPath', page).val(path || "");
@ -29,23 +41,6 @@
if (path) {
var parentPath = path;
if (parentPath.endsWith('\\')) {
parentPath = parentPath.substring(0, parentPath.length - 1);
}
var lastIndex = parentPath.lastIndexOf('\\');
parentPath = lastIndex == -1 ? "" : parentPath.substring(0, lastIndex);
if (parentPath.endsWith(':')) {
parentPath += "\\";
}
if (parentPath == '\\') {
parentPath = "Network";
}
html += '<li><a class="lnkPath lnkDirectory" data-path="' + parentPath + '" href="#">..</a></li>';
}
@ -55,7 +50,7 @@
var cssClass = folder.Type == "File" ? "lnkPath lnkFile" : "lnkPath lnkDirectory";
html += '<li><a class="' + cssClass + '" data-path="' + folder.Path + '" href="#">' + folder.Name + '</a></li>';
html += '<li><a class="' + cssClass + '" data-type="' + folder.Type + '" data-path="' + folder.Path + '" href="#">' + folder.Name + '</a></li>';
}
if (!path) {

View file

@ -38,7 +38,6 @@
useAverageAspectRatio: true,
shape: "backdrop",
showTitle: true,
showProgressBar: true,
showParentTitle: true,
overlayText: true
});
@ -49,15 +48,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -37,14 +37,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -63,14 +63,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -38,14 +38,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -40,14 +40,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -357,15 +357,6 @@
} else {
$('#itemBirthLocation', page).hide();
}
var elem = $('.detailSectionContent', page)[0];
var text = elem.textContent || elem.innerText;
if (!text.trim()) {
$('#detailSection', page).hide();
} else {
$('#detailSection', page).show();
}
}
function renderUserDataIcons(page, item) {
@ -404,7 +395,7 @@
SortOrder: "Ascending",
IncludeItemTypes: "",
Recursive: true,
Fields: "DateCreated,AudioInfo,SeriesInfo,ParentId",
Fields: "DateCreated,AudioInfo,SeriesInfo,ParentId,PrimaryImageAspectRatio",
Limit: LibraryBrowser.getDefaultPageSize(),
StartIndex: 0
};
@ -432,8 +423,53 @@
showArtist: true
});
}
else if (query.IncludeItemTypes == "Movie" || query.IncludeItemTypes == "Trailer") {
} else {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "portrait",
context: 'movies',
useAverageAspectRatio: true,
showTitle: true
});
}
else if (query.IncludeItemTypes == "Episode") {
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
useAverageAspectRatio: true,
shape: "backdrop",
showTitle: true,
showParentTitle: true,
overlayText: true
});
}
else if (query.IncludeItemTypes == "Series") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "backdrop",
preferThumb: true,
context: 'tv'
});
}
else if (query.IncludeItemTypes == "MusicAlbum") {
html = LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "square",
context: 'music',
useAverageAspectRatio: true,
showTitle: true,
showParentTitle: true
});
}
else {
html += LibraryBrowser.getPosterDetailViewHtml({
items: result.Items,

View file

@ -49,14 +49,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -379,7 +379,7 @@
var cssClass = "detailTable";
html += '<div class="detailTableContainer"><table class="' + cssClass + '">';
html += '<div class="detailTableContainer"><table class="' + cssClass + '"><thead>';
html += '<tr>';
@ -399,7 +399,9 @@
html += LibraryBrowser.getSongHeaderCellHtml('Plays', 'desktopColumn', options.enableColumnSorting, 'PlayCount,AlbumArtist,Album,SortName', options.sortBy, options.sortOrder);
html += LibraryBrowser.getSongHeaderCellHtml('', 'desktopColumn userDataCell', options.enableColumnSorting);
html += '</tr>';
html += '</tr></thead>';
html += '<tbody>';
for (var i = 0, length = items.length; i < length; i++) {
@ -461,6 +463,7 @@
html += '</tr>';
}
html += '</tbody>';
html += '</table></div>';
return html;
@ -876,7 +879,14 @@
style += "background-color:" + background + ";";
}
html += '<div class="posterItemImage" style="' + style + '">';
var imageCssClass = 'posterItemImage';
if (options.coverImage) {
imageCssClass += " coveredPosterItemImage";
}
var progressHtml = LibraryBrowser.getItemProgressBarHtml(item);
html += '<div class="' + imageCssClass + '" style="' + style + '">';
if (item.LocationType == "Offline" || item.LocationType == "Virtual") {
if (options.showLocationTypeIndicator !== false) {
@ -885,6 +895,17 @@
} else if (options.showUnplayedIndicator !== false) {
html += LibraryBrowser.getPlayedIndicatorHtml(item);
}
if (!options.overlayText) {
if (progressHtml) {
html += '<div class="posterItemTextOverlay">';
html += "<div class='posterItemProgress miniPosterItemProgress'>";
html += progressHtml;
html += "</div>";
html += "</div>";
}
}
html += '</div>';
var name = LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial);
@ -944,11 +965,9 @@
}
if (options.showProgressBar) {
if (options.overlayText) {
var progressHtml = LibraryBrowser.getItemProgressBarHtml(item);
if (progressHtml || !options.overlayText) {
if (progressHtml) {
html += "<div class='posterItemText posterItemProgress'>";
html += progressHtml || "&nbsp;";
html += "</div>";
@ -1359,11 +1378,6 @@
var sortBy = checkedSortOption.siblings('label[for=' + id + ']').text();
html += 'Sorted by ' + sortBy.trim().toLowerCase() + ', ' + (query.SortOrder || 'ascending').toLowerCase();
if (!checkedSortOption.hasClass('defaultSort')) {
//html += '<button class="btnChangeToDefaultSort" type="button" data-icon="delete" data-inline="true" data-mini="true" data-iconpos="notext">Remove</button>';
}
}
return html;
@ -1482,37 +1496,19 @@
getItemProgressBarHtml: function (item) {
var html = '';
if (item.UserData && item.UserData.PlaybackPositionTicks && item.RunTimeTicks) {
var tooltip;
var pct;
var tooltip = Dashboard.getDisplayTime(item.UserData.PlaybackPositionTicks) + " / " + Dashboard.getDisplayTime(item.RunTimeTicks);
if (item.PlayedPercentage) {
tooltip = item.PlayedPercentage.toFixed(1).toString().replace(".0", '') + '% ';
if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet") {
tooltip += "watched";
} else {
tooltip += "played";
}
pct = item.PlayedPercentage;
}
else if (item.UserData && item.UserData.PlaybackPositionTicks && item.RunTimeTicks) {
tooltip = Dashboard.getDisplayTime(item.UserData.PlaybackPositionTicks) + " / " + Dashboard.getDisplayTime(item.RunTimeTicks);
pct = (item.UserData.PlaybackPositionTicks / item.RunTimeTicks) * 100;
}
var pct = (item.UserData.PlaybackPositionTicks / item.RunTimeTicks) * 100;
if (pct && pct < 100) {
html += '<progress title="' + tooltip + '" class="itemProgressBar" min="0" max="100" value="' + pct + '">';
html += '</progress>';
return '<progress title="' + tooltip + '" class="itemProgressBar" min="0" max="100" value="' + pct + '"></progress>';
}
}
return html;
return null;
},
getUserDataIconsHtml: function (item) {

View file

@ -60,15 +60,6 @@
function renderChannels(page, channels) {
//var pagingHtml = LibraryBrowser.getPagingHtml({
// StartIndex: 0,
// Limit: channels.length
//}, channels.length, true);
//$('.listTopPaging', page).html(pagingHtml).trigger('create');
$('#items', page).html(getChannelsHtml(channels)).trigger('create');
}

View file

@ -0,0 +1,102 @@
(function ($, document) {
// The base query options
var query = {
UserId: Dashboard.getCurrentUserId(),
StartIndex: 0
};
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getLiveTvRecordings(query).done(function (result) {
// Scroll back up so they can see the results from the beginning
$(document).scrollTop(0);
var html = '';
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
updateFilterControls();
html += LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: "square",
showTitle: true,
showParentTitle: true,
overlayText: true,
coverImage: true
});
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
$('#items', page).html(html).trigger('create');
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);
});
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
reloadItems(page);
});
$('.btnPreviousPage', page).on('click', function () {
query.StartIndex -= query.Limit;
reloadItems(page);
});
$('.selectPageSize', page).on('change', function () {
query.Limit = parseInt(this.value);
query.StartIndex = 0;
reloadItems(page);
});
if (getParameterByName('savequery') != 'false') {
LibraryBrowser.saveQueryValues('episodes', query);
}
Dashboard.hideLoadingMsg();
});
}
function updateFilterControls(page) {
}
$(document).on('pageinit', "#liveTvRecordingListPage", function () {
var page = this;
}).on('pagebeforeshow', "#liveTvRecordingListPage", function () {
var limit = LibraryBrowser.getDefaultPageSize();
// If the default page size has changed, the start index will have to be reset
if (limit != query.Limit) {
query.Limit = limit;
query.StartIndex = 0;
}
LibraryBrowser.loadSavedQueryValues('episodes', query);
var groupId = getParameterByName('groupid');
if (groupId) {
query.GroupId = groupId;
}
reloadItems(this);
}).on('pageshow', "#liveTvRecordingListPage", function () {
updateFilterControls(this);
});
})(jQuery, document);

View file

@ -1,52 +1,18 @@
(function ($, document, apiClient) {
function deleteRecording(page, id) {
Dashboard.confirm("Are you sure you wish to delete this recording?", "Confirm Recording Deletion", function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.deleteLiveTvRecording(id).done(function () {
Dashboard.alert('Recording deleted');
reload(page);
});
}
});
}
function loadRecordings(page, elem, groupId) {
var contentElem = $('.recordingList', elem).html('<div class="circle"></div><div class="circle1"></div>');
apiClient.getLiveTvRecordings({
userId: Dashboard.getCurrentUserId(),
groupId: groupId
}).done(function (result) {
renderRecordings(page, contentElem, result.Items);
});
}
function getRecordingGroupHtml(group) {
var html = '';
html += '<div data-role="collapsible" class="recordingGroupCollapsible" data-recordinggroupid="' + group.Id + '" style="margin-top:1em" data-mini="true" data-content-theme="false">';
html += '<li><a href="livetvrecordinglist.html?groupid=' + group.Id + '">';
html += '<h3>' + group.Name + '</h3>';
html += '<h3>';
html += group.Name;
html += '</h3>';
html += '<div class="recordingList">';
html += '</div>';
html += '<span class="ui-li-count">' + group.RecordingCount + '</span>';
html += '</div>';
html += '</li>';
return html;
}
@ -61,100 +27,36 @@
var html = '';
html += '<ul data-role="listview" data-inset="true">';
for (var i = 0, length = groups.length; i < length; i++) {
html += getRecordingGroupHtml(groups[i]);
}
var elem = $('#recordingGroupItems', page).html(html).trigger('create');
$('.recordingGroupCollapsible', elem).on('collapsibleexpand.lazyload', function () {
$(this).off('collapsibleexpand.lazyload');
var groupId = this.getAttribute('data-recordinggroupid');
loadRecordings(page, this, groupId);
});
Dashboard.hideLoadingMsg();
}
function renderRecordings(page, elem, recordings) {
var html = '';
html += '<ul data-role="listview" data-split-icon="delete" data-inset="true">';
for (var i = 0, length = recordings.length; i < length; i++) {
var recording = recordings[i];
html += '<li><a href="livetvrecording.html?id=' + recording.Id + '">';
html += '<h3>';
html += recording.EpisodeTitle || recording.Name;
html += '</h3>';
var startDate = recording.StartDate;
try {
startDate = parseISO8601Date(startDate, { toLocal: true });
} catch (err) {
}
var minutes = recording.RunTimeTicks / 600000000;
minutes = minutes || 1;
html += '<p>';
html += startDate.toLocaleDateString();
html += '&nbsp; &#8226; &nbsp;' + Math.round(minutes) + 'min';
html += '</p>';
if (recording.Status !== 'Completed') {
html += '<p class="ui-li-aside"><span style="color:red;">' + recording.StatusName + '</span></p>';
}
html += '</a>';
html += '<a href="#" class="btnDeleteRecording" data-recordingid="' + recording.Id + '">Delete</a>';
html += '</li>';
}
html += '</ul>';
elem.html(html).trigger('create');
$('.btnDeleteRecording', elem).on('click', function () {
var recordingId = this.getAttribute('data-recordingid');
deleteRecording(page, recordingId);
});
$('#recordingGroupItems', page).html(html).trigger('create');
Dashboard.hideLoadingMsg();
}
function renderLatestRecordings(page, recordings) {
function renderRecordings(elem, recordings) {
if (recordings.length) {
$('#latestRecordings', page).show();
elem.show();
} else {
$('#latestRecordings', page).hide();
elem.hide();
}
$('#latestRecordingItems', page).html(LibraryBrowser.getPosterViewHtml({
$('.recordingItems', elem).html(LibraryBrowser.getPosterViewHtml({
items: recordings,
useAverageAspectRatio: true,
shape: "smallBackdrop",
shape: "square",
showTitle: true,
showParentTitle: true,
overlayText: true
overlayText: true,
coverImage: true
}));
}
@ -163,6 +65,29 @@
Dashboard.showLoadingMsg();
apiClient.getLiveTvRecordings({
userId: Dashboard.getCurrentUserId(),
isRecording: true
}).done(function (result) {
renderRecordings($('#activeRecordings', page), result.Items);
});
apiClient.getLiveTvRecordings({
userId: Dashboard.getCurrentUserId(),
limit: 15,
isRecording: false
}).done(function (result) {
renderRecordings($('#latestRecordings', page), result.Items);
});
apiClient.getLiveTvRecordingGroups({
userId: Dashboard.getCurrentUserId()
@ -172,17 +97,6 @@
renderRecordingGroups(page, result.Items);
});
apiClient.getLiveTvRecordings({
userId: Dashboard.getCurrentUserId(),
limit: 8
}).done(function (result) {
renderLatestRecordings(page, result.Items);
});
}
$(document).on('pagebeforeshow', "#liveTvRecordingsPage", function () {

View file

@ -25,8 +25,9 @@
var cssClass = "detailTable";
html += '<div class="detailTableContainer"><table class="' + cssClass + '">';
html += '<div class="detailTableContainer"><table class="detailTable" >';
html += '<thead>';
html += '<tr>';
html += '<th class="tabletColumn">&nbsp;</th>';
@ -39,6 +40,9 @@
html += '<th class="desktopColumn">Series</th>';
html += '</tr>';
html += '</thead>';
html += '<tbody>';
for (var i = 0, length = timers.length; i < length; i++) {
@ -47,7 +51,7 @@
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 += '<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>';
@ -109,6 +113,7 @@
html += '</tr>';
}
html += '</tbody>';
html += '</table></div>';
var elem = $('#items', page).html(html).trigger('create');

View file

@ -473,6 +473,9 @@
return i.Type == "Video";
})[0];
var h264Codec = 'h264';
var h264AudioCodec = 'aac';
if (videoStream && videoStream.Width) {
if (videoStream.Width >= 1280) {
@ -482,14 +485,15 @@
else if (videoStream.Width >= 720) {
baseParams.videoBitrate = 700000;
}
if ((videoStream.Codec || '').toLowerCase().indexOf('h264') != -1) {
}
}
// Webm must be ahead of mp4 due to the issue of mp4 playing too fast in chrome
var prioritizeWebmOverH264 = $.browser.chrome || $.browser.msie;
var h264Codec = 'h264';
var h264AudioCodec = 'aac';
if (startPosition) {
baseParams.StartTimeTicks = startPosition;
}

View file

@ -42,14 +42,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -39,14 +39,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -64,14 +64,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -46,7 +46,6 @@
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
showProgressBar: true,
preferBackdrop: true,
shape: 'backdrop',
overlayText: true,

View file

@ -42,14 +42,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -45,14 +45,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -40,14 +40,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -56,14 +56,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -39,14 +39,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -38,14 +38,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -62,14 +62,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -6,13 +6,15 @@
html += '<table class="detailTable">';
html += '<tr>';
html += '<thead><tr>';
html += '<th></th>';
html += '<th>Name</th>';
html += '<th>Album</th>';
html += '<th>Time</th>';
html += '<th>Rating</th>';
html += '</tr>';
html += '</tr></thead>';
html += '<tbody>';
$.each(MediaPlayer.playlist, function (i, item) {
@ -30,6 +32,7 @@
html += '</tr>';
});
html += '</tbody>';
html += '</table>';
$("#playlist", page).html(html).trigger('create');

View file

@ -124,7 +124,7 @@ var Dashboard = {
setTimeout(function () {
$.mobile.loading('hide');
}, 2000);
}, 3000);
},
alert: function (options) {
@ -141,7 +141,7 @@ var Dashboard = {
setTimeout(function () {
$.mobile.loading('hide');
}, 4000);
}, 3000);
return;
}

View file

@ -62,14 +62,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -45,14 +45,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -39,14 +39,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -55,7 +55,6 @@
shape: "backdrop",
showTitle: true,
showParentTitle: true,
showProgressBar: true,
overlayText: true
}));

View file

@ -67,14 +67,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

@ -45,14 +45,6 @@
$('#items', page).html(html).trigger('create');
$('.btnChangeToDefaultSort', page).on('click', function () {
query.StartIndex = 0;
query.SortOrder = 'Ascending';
query.SortBy = $('.defaultSort', page).data('sortby');
reloadItems(page);
});
$('.selectPage', page).on('change', function () {
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
reloadItems(page);

View file

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