mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
fixes #839 - Support getting latest channel items
This commit is contained in:
parent
77b267a916
commit
4beb349afe
@ -7,6 +7,7 @@
|
||||
<div id="channelsPage" data-role="page" class="page libraryPage channelsPage" data-theme="b" data-contextname="${HeaderChannels}">
|
||||
|
||||
<div class="libraryViewNav scopedLibraryViewNav">
|
||||
<a href="channelslatest.html">${TabLatest}</a>
|
||||
<a href="#" class="ui-btn-active">${TabChannels}</a>
|
||||
</div>
|
||||
|
||||
|
21
dashboard-ui/channelslatest.html
Normal file
21
dashboard-ui/channelslatest.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleMediaBrowser}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="channelsLatestPage" data-role="page" class="page libraryPage channelsPage" data-theme="b" data-contextname="${HeaderChannels}">
|
||||
|
||||
<div class="libraryViewNav scopedLibraryViewNav">
|
||||
<a href="#" class="ui-btn-active">${TabLatest}</a>
|
||||
<a href="channels.html">${TabChannels}</a>
|
||||
</div>
|
||||
|
||||
<div data-role="content">
|
||||
<div class="viewSettings">
|
||||
</div>
|
||||
<div id="items" class="itemsContainer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -46,10 +46,13 @@
|
||||
}
|
||||
|
||||
.listHeader {
|
||||
margin-top: .7em;
|
||||
margin-top: .5em;
|
||||
margin-bottom: 0;
|
||||
padding-left: 4px;
|
||||
}
|
||||
.firstListHeader {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.ehsContent {
|
||||
padding: 0;
|
||||
@ -69,7 +72,7 @@
|
||||
}
|
||||
|
||||
.homePageSection + .homePageSection {
|
||||
margin-top: 2em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
@media all and (min-width: 1000px) {
|
||||
|
@ -122,8 +122,7 @@
|
||||
left: 0;
|
||||
top: 51px;
|
||||
z-index: 1000;
|
||||
background-color: #181818;
|
||||
background-color: rgba(24, 24, 24, 1);
|
||||
background-color: #161616;
|
||||
}
|
||||
|
||||
@media all and (max-width: 460px) {
|
||||
|
@ -27,6 +27,7 @@
|
||||
<select id="selectHomeSection1" data-mini="true">
|
||||
<option value="">${OptionAuto}</option>
|
||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||
<option value="latestchannelmedia">${OptionLatestChannelMedia}</option>
|
||||
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||
@ -39,6 +40,7 @@
|
||||
<select id="selectHomeSection2" data-mini="true">
|
||||
<option value="">${OptionAuto}</option>
|
||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||
<option value="latestchannelmedia">${OptionLatestChannelMedia}</option>
|
||||
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||
@ -52,6 +54,21 @@
|
||||
<select id="selectHomeSection3" data-mini="true">
|
||||
<option value="">${OptionAuto}</option>
|
||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||
<option value="latestchannelmedia">${OptionLatestChannelMedia}</option>
|
||||
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||
<option value="folders">${OptionLibraryFolders}</option>
|
||||
<option value="resume">${OptionResumablemedia}</option>
|
||||
<option value="none">${OptionNone}</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label for="selectHomeSection4">${LabelHomePageSection4}</label>
|
||||
<select id="selectHomeSection4" data-mini="true">
|
||||
<option value="">${OptionAuto}</option>
|
||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||
<option value="latestchannelmedia">${OptionLatestChannelMedia}</option>
|
||||
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||
|
@ -98,6 +98,11 @@
|
||||
if ($.browser.msie) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// For bandwidth
|
||||
if ($.browser.mobile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
var downloadableList = allChannelFeatures.filter(function (i) {
|
||||
return i.CanDownloadAllMedia;
|
||||
return i.SupportsContentDownloading;
|
||||
});
|
||||
|
||||
populateDownloadList(page, config, downloadableList);
|
||||
|
40
dashboard-ui/scripts/channelslatest.js
Normal file
40
dashboard-ui/scripts/channelslatest.js
Normal file
@ -0,0 +1,40 @@
|
||||
(function ($, document) {
|
||||
|
||||
function reloadItems(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var options = {
|
||||
|
||||
Limit: 30,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsUnplayed",
|
||||
UserId: Dashboard.getCurrentUserId()
|
||||
};
|
||||
|
||||
$.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: 'auto',
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
context: 'channels',
|
||||
lazy: true
|
||||
});
|
||||
|
||||
$("#items", page).html(html).trigger('create').createPosterItemMenus();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#channelsLatestPage", function () {
|
||||
|
||||
reloadItems(this);
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
@ -108,6 +108,8 @@
|
||||
return 'resume';
|
||||
case 2:
|
||||
return 'latestmedia';
|
||||
case 3:
|
||||
return 'latestchannelmedia';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@ -147,7 +149,7 @@
|
||||
|
||||
SortBy: "DateCreated",
|
||||
SortOrder: "Descending",
|
||||
Limit: screenWidth >= 2400 ? 30 : (screenWidth >= 1920 ? 20 : (screenWidth >= 1440 ? 12 : (screenWidth >= 800 ? 12 : 8))),
|
||||
Limit: screenWidth >= 2400 ? 30 : (screenWidth >= 1920 ? 20 : (screenWidth >= 1440 ? 12 : (screenWidth >= 800 ? 9 : 8))),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsUnplayed,IsNotFolder",
|
||||
@ -179,6 +181,41 @@
|
||||
});
|
||||
}
|
||||
|
||||
function loadLatestChannelMedia(elem, userId) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var options = {
|
||||
|
||||
Limit: 6,
|
||||
Fields: "PrimaryImageAspectRatio",
|
||||
Filters: "IsUnplayed",
|
||||
UserId: userId
|
||||
};
|
||||
|
||||
$.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (result.Items.length) {
|
||||
html += '<h1 class="listHeader">' + Globalize.translate('HeaderLatestChannelMedia') + '</h1>';
|
||||
html += '<div>';
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
preferThumb: true,
|
||||
shape: 'auto',
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
context: 'home',
|
||||
lazy: true
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$(elem).html(html).trigger('create').createPosterItemMenus();
|
||||
});
|
||||
}
|
||||
|
||||
function loadLibraryTiles(elem, userId, shape, index) {
|
||||
|
||||
getUserViews(userId).done(function (items) {
|
||||
@ -289,7 +326,7 @@
|
||||
var section = displayPreferences.CustomPrefs['home' + index] || getDefaultSection(index);
|
||||
|
||||
var elem = $('.section' + index, page);
|
||||
|
||||
|
||||
if (section == 'latestmedia') {
|
||||
loadRecentlyAdded(elem, userId);
|
||||
}
|
||||
@ -308,6 +345,9 @@
|
||||
} else if (section == 'folders') {
|
||||
loadLibraryFolders(elem, userId, 'backdrop', index);
|
||||
|
||||
} else if (section == 'latestchannelmedia') {
|
||||
loadLatestChannelMedia(elem, userId);
|
||||
|
||||
} else {
|
||||
|
||||
elem.empty();
|
||||
@ -317,7 +357,7 @@
|
||||
function loadSections(page, userId, displayPreferences) {
|
||||
|
||||
var i, length;
|
||||
var sectionCount = 3;
|
||||
var sectionCount = 4;
|
||||
|
||||
var elem = $('.sections', page);
|
||||
|
||||
|
@ -370,7 +370,7 @@
|
||||
}
|
||||
|
||||
if (item.CollectionType == 'channels') {
|
||||
return 'channels.html';
|
||||
return 'channelslatest.html';
|
||||
}
|
||||
|
||||
if (item.CollectionType == 'movies') {
|
||||
|
@ -235,6 +235,10 @@
|
||||
|
||||
self.updateTextStreamUrls = function (startPositionTicks) {
|
||||
|
||||
if (!self.supportsTextTracks()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('track', video).each(function () {
|
||||
|
||||
var currentSrc = this.src;
|
||||
@ -242,6 +246,7 @@
|
||||
currentSrc = replaceQueryString(currentSrc, 'startPositionTicks', startPositionTicks);
|
||||
|
||||
this.src = currentSrc;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -232,11 +232,12 @@
|
||||
|
||||
self.supportsTextTracks = function () {
|
||||
|
||||
// Does not support changing tracks via mode property
|
||||
if ($.browser.mozilla) {
|
||||
// When seeking with transcoding, there repointing the track element
|
||||
// to a new url (via src) doesn't seem to work.
|
||||
if ($.browser.chrome) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (supportsTextTracks == null) {
|
||||
|
||||
supportsTextTracks = document.createElement('video').textTracks != null;
|
||||
|
@ -8,6 +8,7 @@
|
||||
$('#selectHomeSection1', page).val(displayPreferences.CustomPrefs.home0 || '').selectmenu("refresh");
|
||||
$('#selectHomeSection2', page).val(displayPreferences.CustomPrefs.home1 || '').selectmenu("refresh");
|
||||
$('#selectHomeSection3', page).val(displayPreferences.CustomPrefs.home2 || '').selectmenu("refresh");
|
||||
$('#selectHomeSection4', page).val(displayPreferences.CustomPrefs.home3 || '').selectmenu("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
@ -20,6 +21,7 @@
|
||||
displayPreferences.CustomPrefs.home0 = $('#selectHomeSection1', page).val();
|
||||
displayPreferences.CustomPrefs.home1 = $('#selectHomeSection2', page).val();
|
||||
displayPreferences.CustomPrefs.home2 = $('#selectHomeSection3', page).val();
|
||||
displayPreferences.CustomPrefs.home3 = $('#selectHomeSection4', page).val();
|
||||
|
||||
ApiClient.updateDisplayPreferences('home', displayPreferences, userId, 'webclient').done(function () {
|
||||
|
||||
|
@ -413,6 +413,7 @@
|
||||
var playerInfo = MediaController.getPlayerInfo();
|
||||
|
||||
var supportedCommands = playerInfo.supportedCommands;
|
||||
var playState = state.PlayState || {};
|
||||
|
||||
$('.btnToggleFullscreen', page).buttonEnabled(item && item.MediaType == 'Video' && supportedCommands.indexOf('ToggleFullscreen') != -1);
|
||||
|
||||
@ -437,8 +438,6 @@
|
||||
var btnPause = $('.btnPause', page).buttonEnabled(item != null);
|
||||
var btnPlay = $('.btnPlay', page).buttonEnabled(item != null);
|
||||
|
||||
var playState = state.PlayState || {};
|
||||
|
||||
if (playState.IsPaused) {
|
||||
|
||||
hideButton(btnPause);
|
||||
|
@ -1,8 +1,6 @@
|
||||
(function ($, document) {
|
||||
|
||||
function loadNextUp(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
function reload(page) {
|
||||
|
||||
var query = {
|
||||
|
||||
@ -18,10 +16,47 @@
|
||||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
$('.homeEhsContent', page).css('text-align', 'left');
|
||||
$('.scopedContent', page).show();
|
||||
|
||||
loadResume(page);
|
||||
|
||||
} else {
|
||||
$('.scopedLibraryViewNav', page).hide();
|
||||
$('.globalNav', page).show();
|
||||
$('.homeEhsContent', page).css('text-align', 'center');
|
||||
$('.scopedContent', page).hide();
|
||||
}
|
||||
|
||||
loadNextUp(page);
|
||||
}
|
||||
|
||||
function loadNextUp(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var query = {
|
||||
|
||||
Limit: 24,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
ExcludeLocationTypes: "Virtual"
|
||||
};
|
||||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
if (query.ParentId) {
|
||||
|
||||
$('.scopedLibraryViewNav', page).show();
|
||||
$('.globalNav', page).hide();
|
||||
$('.ehsContent', page).css('text-align', 'left').removeClass('homeEhsContent');
|
||||
$('.scopedContent', page).show();
|
||||
|
||||
} else {
|
||||
$('.scopedLibraryViewNav', page).hide();
|
||||
$('.globalNav', page).show();
|
||||
$('.ehsContent', page).css('text-align', 'center').addClass('homeEhsContent');
|
||||
$('.scopedContent', page).hide();
|
||||
}
|
||||
|
||||
ApiClient.getNextUpEpisodes(query).done(function (result) {
|
||||
@ -46,11 +81,50 @@
|
||||
});
|
||||
}
|
||||
|
||||
function loadResume(page) {
|
||||
|
||||
var screenWidth = $(window).width();
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 5 : 4,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
ParentId: parentId
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
} else {
|
||||
$('#resumableSection', page).hide();
|
||||
}
|
||||
|
||||
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "backdrop",
|
||||
showTitle: true,
|
||||
showParentTitle: true,
|
||||
overlayText: screenWidth >= 600
|
||||
|
||||
})).createPosterItemMenus();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#tvRecommendedPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
loadNextUp(page);
|
||||
reload(page);
|
||||
});
|
||||
|
||||
|
||||
|
@ -3419,6 +3419,8 @@ MediaBrowser.SHA1 = function (msg) {
|
||||
} else if (browser.webkit) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
browser.mobile = (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
|
||||
|
||||
jQuery.browser = browser;
|
||||
|
||||
|
@ -23,10 +23,21 @@
|
||||
</div>
|
||||
<br />
|
||||
<div data-role="content">
|
||||
<table class="ehsContent homeEhsContent" style="text-align: center;">
|
||||
<table class="ehsContent">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<div class="scopedContent">
|
||||
<div id="resumableSection" style="display: none;">
|
||||
<h1 class="listHeader firstListHeader">${HeaderResume}</h1>
|
||||
|
||||
<div id="resumableItems">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 class="listHeader">${HeaderNextUp}</h1>
|
||||
</div>
|
||||
|
||||
<div id="nextUpItems">
|
||||
</div>
|
||||
<p class="noNextUpItems" style="display: none;">${NoNextUpItemsMessage}</p>
|
||||
|
Loading…
Reference in New Issue
Block a user