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:
parent
2861ff68c9
commit
7743b36bc9
46 changed files with 421 additions and 504 deletions
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
else if (item.Type == "Genre" || item.Type == "Studio" || item.Type == "Person" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.Type == "GameGenre") {
|
||||
|
||||
var itemCountHtml = LibraryBrowser.getItemCountsHtml(options, item);
|
||||
|
||||
|
||||
if (itemCountHtml) {
|
||||
html += '<p class="itemMiscInfo">' + itemCountHtml + '</p>';
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -916,11 +937,11 @@
|
|||
html += name;
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
|
||||
if (options.showItemCounts) {
|
||||
|
||||
var itemCountHtml = LibraryBrowser.getItemCountsHtml(options, item);
|
||||
|
||||
|
||||
if (itemCountHtml) {
|
||||
html += "<div class='" + cssclass + "'>";
|
||||
html += itemCountHtml;
|
||||
|
@ -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 || " ";
|
||||
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) {
|
||||
var pct = (item.UserData.PlaybackPositionTicks / item.RunTimeTicks) * 100;
|
||||
|
||||
tooltip = item.PlayedPercentage.toFixed(1).toString().replace(".0", '') + '% ';
|
||||
if (pct && pct < 100) {
|
||||
|
||||
if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet") {
|
||||
tooltip += "watched";
|
||||
} else {
|
||||
tooltip += "played";
|
||||
return '<progress title="' + tooltip + '" class="itemProgressBar" min="0" max="100" value="' + pct + '"></progress>';
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (pct && pct < 100) {
|
||||
|
||||
html += '<progress title="' + tooltip + '" class="itemProgressBar" min="0" max="100" value="' + pct + '">';
|
||||
html += '</progress>';
|
||||
}
|
||||
|
||||
return html;
|
||||
return null;
|
||||
},
|
||||
|
||||
getUserDataIconsHtml: function (item) {
|
||||
|
@ -1993,7 +1989,7 @@
|
|||
}
|
||||
|
||||
var progressHtml = LibraryBrowser.getItemProgressBarHtml(item);
|
||||
|
||||
|
||||
if (progressHtml) {
|
||||
html += '<div class="detailImageProgressContainer">';
|
||||
html += progressHtml;
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
102
dashboard-ui/scripts/livetvrecordinglist.js
Normal file
102
dashboard-ui/scripts/livetvrecordinglist.js
Normal 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);
|
|
@ -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 += ' • ' + 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 () {
|
||||
|
|
|
@ -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"> </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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
showProgressBar: true,
|
||||
preferBackdrop: true,
|
||||
shape: 'backdrop',
|
||||
overlayText: true,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
shape: "backdrop",
|
||||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
showProgressBar: true,
|
||||
overlayText: true
|
||||
}));
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue