mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merging in latest dev
This commit is contained in:
commit
717b58d43c
95 changed files with 1007 additions and 959 deletions
|
@ -265,7 +265,10 @@
|
|||
|
||||
});
|
||||
|
||||
}).on('pagebeforeshow pageinit', "#addPluginPage", function () {
|
||||
|
||||
}).on('pagebeforeshow pageinit pageshow', "#addPluginPage", function () {
|
||||
|
||||
// This needs both events for the helpurl to get done at the right time
|
||||
|
||||
var page = this;
|
||||
|
||||
|
@ -274,12 +277,24 @@
|
|||
if (context == 'sync') {
|
||||
$('.syncTabs', page).show();
|
||||
$('.pluginTabs', page).hide();
|
||||
$('.livetvTabs', page).hide();
|
||||
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleSync'));
|
||||
} else {
|
||||
}
|
||||
else if (context == 'livetv') {
|
||||
|
||||
$('.syncTabs', page).hide();
|
||||
$('.pluginTabs', page).hide();
|
||||
$('.livetvTabs', page).show();
|
||||
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleLiveTV'));
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV');
|
||||
}
|
||||
else {
|
||||
$('.syncTabs', page).hide();
|
||||
$('.pluginTabs', page).show();
|
||||
$('.livetvTabs', page).hide();
|
||||
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Plugins');
|
||||
Dashboard.setPageTitle(Globalize.translate('TitlePlugins'));
|
||||
|
|
110
dashboard-ui/scripts/appservices.js
Normal file
110
dashboard-ui/scripts/appservices.js
Normal file
|
@ -0,0 +1,110 @@
|
|||
(function ($, document) {
|
||||
|
||||
function reloadList(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var promise1 = ApiClient.getAvailablePlugins({
|
||||
TargetSystems: 'Server'
|
||||
});
|
||||
|
||||
var promise2 = ApiClient.getInstalledPlugins();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
renderInstalled(page, response1[0], response2[0]);
|
||||
renderCatalog(page, response1[0], response2[0]);
|
||||
});
|
||||
}
|
||||
|
||||
function getCategories() {
|
||||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
var categories = [];
|
||||
|
||||
if (context == 'sync') {
|
||||
categories.push('Sync');
|
||||
}
|
||||
else if (context == 'livetv') {
|
||||
categories.push('Live TV');
|
||||
}
|
||||
|
||||
return categories;
|
||||
}
|
||||
|
||||
function renderInstalled(page, availablePlugins, installedPlugins) {
|
||||
|
||||
var category = getCategories()[0];
|
||||
|
||||
installedPlugins = installedPlugins.filter(function (i) {
|
||||
|
||||
var catalogEntry = availablePlugins.filter(function (a) {
|
||||
return a.guid == i.Id;
|
||||
})[0];
|
||||
|
||||
return catalogEntry && catalogEntry.category == category;
|
||||
|
||||
});
|
||||
|
||||
PluginsPage.renderPlugins(page, installedPlugins);
|
||||
}
|
||||
|
||||
function renderCatalog(page, availablePlugins, installedPlugins) {
|
||||
|
||||
var categories = getCategories();
|
||||
|
||||
PluginCatalog.renderCatalog({
|
||||
|
||||
catalogElement: $('.catalog', page),
|
||||
availablePlugins: availablePlugins,
|
||||
installedPlugins: installedPlugins,
|
||||
categories: categories,
|
||||
showCategory: false,
|
||||
context: getParameterByName('context'),
|
||||
targetSystem: 'Server'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow pageinit pageshow', "#appServicesPage", function () {
|
||||
|
||||
// This needs both events for the helpurl to get done at the right time
|
||||
|
||||
var page = this;
|
||||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
$('.sectionTabs', page).hide();
|
||||
$('.' + context + 'SectionTabs', page).show();
|
||||
|
||||
if (context == 'sync') {
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleSync'));
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
|
||||
}
|
||||
else if (context == 'livetv') {
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleLiveTV'));
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV');
|
||||
}
|
||||
|
||||
}).on('pageshow', "#appServicesPage", function () {
|
||||
|
||||
// This needs both events for the helpurl to get done at the right time
|
||||
|
||||
var page = this;
|
||||
|
||||
reloadList(page);
|
||||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter || context != 'sync') {
|
||||
$('.syncPromotion', page).hide();
|
||||
} else {
|
||||
$('.syncPromotion', page).show();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
|
@ -24,12 +24,6 @@
|
|||
|
||||
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
$('.supporterPromotion', page).hide();
|
||||
} else {
|
||||
$('.supporterPromotion', page).show();
|
||||
}
|
||||
|
||||
DashboardPage.renderSupporterIcon(page, pluginSecurityInfo);
|
||||
});
|
||||
|
||||
|
@ -625,7 +619,7 @@
|
|||
|
||||
return "<img src='css/images/clients/mbc.png' />";
|
||||
}
|
||||
if (clientLowered == "media browser theater") {
|
||||
if (clientLowered == "emby theater") {
|
||||
|
||||
return "<img src='css/images/clients/mb.png' />";
|
||||
}
|
||||
|
@ -1288,7 +1282,7 @@ $(document).on('pagebeforeshow', "#dashboardPage", DashboardPage.onPageShow)
|
|||
$('.tourButtonText', elem).html(Globalize.translate('ButtonTakeTheTourToSeeWhatsNew'));
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
$('.tourHeader', elem).html(Globalize.translate('HeaderWelcomeToProjectServerDashboard'));
|
||||
$('.tourButtonText', elem).html(Globalize.translate('ButtonTakeTheTour'));
|
||||
}
|
||||
|
@ -1338,4 +1332,26 @@ $(document).on('pagebeforeshow', "#dashboardPage", DashboardPage.onPageShow)
|
|||
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
||||
})(jQuery, document, window);
|
||||
|
||||
(function () {
|
||||
|
||||
$(document).on('pagebeforeshow', ".type-interior", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
|
||||
|
||||
if (!$('.staticSupporterPromotion', page).length) {
|
||||
$('.supporterPromotion', page).remove();
|
||||
|
||||
if (!pluginSecurityInfo.IsMBSupporter) {
|
||||
$('.content-primary', page).append('<div class="supporterPromotion"><a class="btn btnActionAccent" href="supporter.html" style="font-size:14px;"><div>' + Globalize.translate('HeaderSupportTheTeam') + '</div><div style="font-weight:normal;font-size:90%;margin-top:5px;">' + Globalize.translate('TextEnjoyBonusFeatures') + '</div></a></div>');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})();
|
|
@ -3,7 +3,8 @@
|
|||
function loadPage(page, config) {
|
||||
|
||||
$('#chkEnableDebugEncodingLogging', page).checked(config.EnableDebugLogging).checkboxradio('refresh');
|
||||
|
||||
$('#chkEnableThrottle', page).checked(config.EnableThrottling).checkboxradio('refresh');
|
||||
|
||||
$('.radioEncodingQuality', page).each(function() {
|
||||
|
||||
this.checked = config.EncodingQuality == this.value;
|
||||
|
@ -67,6 +68,7 @@
|
|||
config.EncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
||||
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
config.EnableThrottling = $('#chkEnableThrottle', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("encoding", config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
SortBy: "SortName",
|
||||
SortOrder: "Ascending",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated",
|
||||
Fields: "DateCreated,ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
SortOrder: "Ascending",
|
||||
MediaTypes: "Game",
|
||||
Recursive: true,
|
||||
Fields: "UserData",
|
||||
Fields: "ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -125,7 +125,6 @@
|
|||
|
||||
Limit: 24,
|
||||
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
||||
IsPlayed: false,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
@ -470,7 +469,7 @@
|
|||
switch (index) {
|
||||
|
||||
case 0:
|
||||
return 'smalllibrarytiles-automobile';
|
||||
return 'librarytiles-automobile';
|
||||
case 1:
|
||||
return 'resume';
|
||||
case 2:
|
||||
|
|
|
@ -477,7 +477,7 @@
|
|||
|
||||
if (context != 'folders') {
|
||||
if (item.CollectionType == 'movies') {
|
||||
return 'movieslatest.html?topParentId=' + item.Id;
|
||||
return 'moviesrecommended.html?topParentId=' + item.Id;
|
||||
}
|
||||
|
||||
if (item.CollectionType == 'boxsets') {
|
||||
|
@ -1257,10 +1257,6 @@
|
|||
|
||||
if (options.showChildCountIndicator && item.ChildCount) {
|
||||
cssClass += ' groupedCard';
|
||||
|
||||
if (item.Type == 'Series') {
|
||||
cssClass += ' unplayedGroupings';
|
||||
}
|
||||
}
|
||||
|
||||
if (options.showTitle && !options.overlayText) {
|
||||
|
|
|
@ -512,10 +512,6 @@
|
|||
GroupItems: false
|
||||
};
|
||||
|
||||
if ($(card).hasClass('unplayedGroupings')) {
|
||||
options.IsPlayed = false;
|
||||
}
|
||||
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options));
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// The base query options
|
||||
var query = {
|
||||
UserId: Dashboard.getCurrentUserId(),
|
||||
SortBy: "PremiereDate,SortName",
|
||||
SortBy: "StartDate,SortName",
|
||||
SortOrder: "Ascending",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
@ -19,19 +19,6 @@
|
|||
|
||||
function updateFilterControls(page) {
|
||||
|
||||
// Reset form values using the last used query
|
||||
$('.radioSortBy', page).each(function () {
|
||||
|
||||
this.checked = (query.SortBy || '').toLowerCase() == this.getAttribute('data-sortby').toLowerCase();
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('.radioSortOrder', page).each(function () {
|
||||
|
||||
this.checked = (query.SortOrder || '').toLowerCase() == this.getAttribute('data-sortorder').toLowerCase();
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('#selectView', page).val(view).selectmenu('refresh');
|
||||
$('.alphabetPicker', page).alphaValue(query.NameStartsWithOrGreater);
|
||||
$('#selectPageSize', page).val(query.Limit).selectmenu('refresh');
|
||||
|
@ -58,7 +45,6 @@
|
|||
$('.listTopPaging', page).html(pagingHtml).trigger('create');
|
||||
|
||||
updateFilterControls(page);
|
||||
var trigger = false;
|
||||
|
||||
if (view == "Poster") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
|
@ -112,18 +98,6 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
$('.radioSortBy', this).on('click', function () {
|
||||
query.StartIndex = 0;
|
||||
query.SortBy = this.getAttribute('data-sortby');
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('.radioSortOrder', this).on('click', function () {
|
||||
query.StartIndex = 0;
|
||||
query.SortOrder = this.getAttribute('data-sortorder');
|
||||
reloadItems(page);
|
||||
});
|
||||
|
||||
$('#selectView', this).on('change', function () {
|
||||
|
||||
view = this.value;
|
||||
|
@ -179,6 +153,7 @@
|
|||
}
|
||||
|
||||
query.IsMovie = getParameterByName('type') == 'movies' ? true : null;
|
||||
query.IsSports = getParameterByName('type') == 'sports' ? true : null;
|
||||
|
||||
var viewkey = getSavedQueryKey();
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
IsAiring: false,
|
||||
HasAired: false,
|
||||
limit: 10,
|
||||
IsMovie: false
|
||||
IsMovie: false,
|
||||
IsSports: false
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
|
@ -73,6 +74,28 @@
|
|||
|
||||
$('.upcomingTvMovieItems', page).html(html).lazyChildren();
|
||||
});
|
||||
|
||||
ApiClient.getLiveTvRecommendedPrograms({
|
||||
|
||||
userId: Dashboard.getCurrentUserId(),
|
||||
IsAiring: false,
|
||||
HasAired: false,
|
||||
limit: 10,
|
||||
IsSports: true
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
var html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "auto",
|
||||
showTitle: true,
|
||||
coverImage: true,
|
||||
overlayText: false,
|
||||
lazy: true
|
||||
});
|
||||
|
||||
$('.upcomingSportsItems', page).html(html).lazyChildren();
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', "#liveTvSuggestedPage", function () {
|
||||
|
|
|
@ -53,13 +53,21 @@
|
|||
|
||||
}).on('playbackstop.mediacontroller', function (e, state) {
|
||||
|
||||
ApiClient.reportPlaybackStopped({
|
||||
|
||||
var stopInfo = {
|
||||
itemId: state.NowPlayingItem.Id,
|
||||
mediaSourceId: state.PlayState.MediaSourceId,
|
||||
positionTicks: state.PlayState.PositionTicks
|
||||
};
|
||||
|
||||
});
|
||||
if (state.PlayState.LiveStreamId) {
|
||||
stopInfo.LiveStreamId = state.PlayState.LiveStreamId;
|
||||
}
|
||||
|
||||
if (state.PlayState.PlaySessionId) {
|
||||
stopInfo.PlaySessionId = state.PlayState.PlaySessionId;
|
||||
}
|
||||
|
||||
ApiClient.reportPlaybackStopped(stopInfo);
|
||||
|
||||
}).on('positionchange.mediacontroller', function (e, state) {
|
||||
|
||||
|
|
|
@ -143,10 +143,6 @@
|
|||
self.changeStream(self.getCurrentTicks(), { AudioStreamIndex: index });
|
||||
};
|
||||
|
||||
self.supportsSubtitleStreamExternally = function (stream) {
|
||||
return stream.Type == 'Subtitle' && stream.IsTextSubtitleStream && stream.SupportsExternalStream;
|
||||
}
|
||||
|
||||
self.setSubtitleStreamIndex = function (index) {
|
||||
|
||||
if (!self.supportsTextTracks()) {
|
||||
|
@ -166,7 +162,7 @@
|
|||
|
||||
if (currentStream && !newStream) {
|
||||
|
||||
if (!self.supportsSubtitleStreamExternally(currentStream)) {
|
||||
if (currentStream.DeliveryMethod != 'External') {
|
||||
|
||||
// Need to change the transcoded stream to remove subs
|
||||
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 });
|
||||
|
@ -174,7 +170,7 @@
|
|||
}
|
||||
else if (!currentStream && newStream) {
|
||||
|
||||
if (self.supportsSubtitleStreamExternally(newStream)) {
|
||||
if (newStream.DeliveryMethod == 'External') {
|
||||
selectedTrackElementIndex = index;
|
||||
} else {
|
||||
|
||||
|
@ -184,10 +180,10 @@
|
|||
}
|
||||
else if (currentStream && newStream) {
|
||||
|
||||
if (self.supportsSubtitleStreamExternally(newStream)) {
|
||||
if (newStream.DeliveryMethod == 'External') {
|
||||
selectedTrackElementIndex = index;
|
||||
|
||||
if (!self.supportsSubtitleStreamExternally(currentStream)) {
|
||||
if (currentStream.DeliveryMethod != 'External') {
|
||||
self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 });
|
||||
}
|
||||
} else {
|
||||
|
@ -207,7 +203,7 @@
|
|||
var modes = ['disabled', 'showing', 'hidden'];
|
||||
|
||||
var textStreams = self.currentMediaSource.MediaStreams.filter(function (s) {
|
||||
return self.supportsSubtitleStreamExternally(s);
|
||||
return s.DeliveryMethod == 'External';
|
||||
});
|
||||
|
||||
var newStream = textStreams.filter(function (s) {
|
||||
|
@ -428,14 +424,12 @@
|
|||
|
||||
if (!$(this).hasClass('selectedMediaPopupOption')) {
|
||||
|
||||
var maxWidth = parseInt(this.getAttribute('data-maxwidth'));
|
||||
var bitrate = parseInt(this.getAttribute('data-bitrate'));
|
||||
|
||||
AppSettings.maxStreamingBitrate(bitrate);
|
||||
|
||||
self.changeStream(self.getCurrentTicks(), {
|
||||
|
||||
MaxWidth: maxWidth,
|
||||
Bitrate: bitrate
|
||||
});
|
||||
}
|
||||
|
@ -796,7 +790,12 @@
|
|||
var currentSrc = self.getCurrentSrc(self.currentMediaElement).toLowerCase();
|
||||
var isStatic = currentSrc.indexOf('static=true') != -1;
|
||||
|
||||
var options = getVideoQualityOptions(self.currentMediaSource.MediaStreams);
|
||||
var videoStream = self.currentMediaSource.MediaStreams.filter(function (stream) {
|
||||
return stream.Type == "Video";
|
||||
})[0];
|
||||
var videoWidth = videoStream ? videoStream.Width : null;
|
||||
|
||||
var options = self.getVideoQualityOptions(videoWidth);
|
||||
|
||||
if (isStatic) {
|
||||
options[0].name = "Direct";
|
||||
|
@ -819,7 +818,7 @@
|
|||
cssClass += ' selectedMediaPopupOption';
|
||||
}
|
||||
|
||||
var optionHtml = '<li><a data-maxwidth="' + option.maxWidth + '" data-bitrate="' + option.bitrate + '" class="' + cssClass + '" href="#">';
|
||||
var optionHtml = '<li><a data-bitrate="' + option.bitrate + '" class="' + cssClass + '" href="#">';
|
||||
|
||||
optionHtml += '<p style="margin:0;">';
|
||||
|
||||
|
@ -845,85 +844,6 @@
|
|||
return html;
|
||||
}
|
||||
|
||||
function getVideoQualityOptions(mediaStreams) {
|
||||
|
||||
var videoStream = mediaStreams.filter(function (stream) {
|
||||
return stream.Type == "Video";
|
||||
})[0];
|
||||
|
||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||
|
||||
var maxAllowedWidth = self.getMaxPlayableWidth();
|
||||
|
||||
var options = [];
|
||||
|
||||
// We have media info
|
||||
if (videoStream && videoStream.Width) {
|
||||
|
||||
maxAllowedWidth = videoStream.Width;
|
||||
}
|
||||
|
||||
// Some 1080- videos are reported as 1912?
|
||||
if (maxAllowedWidth >= 1900) {
|
||||
options.push({ name: '1080p - 30Mbps', maxWidth: 1920, bitrate: 30000000 });
|
||||
options.push({ name: '1080p - 25Mbps', maxWidth: 1920, bitrate: 25000000 });
|
||||
options.push({ name: '1080p - 20Mbps', maxWidth: 1920, bitrate: 20000000 });
|
||||
options.push({ name: '1080p - 15Mbps', maxWidth: 1920, bitrate: 15000000 });
|
||||
options.push({ name: '1080p - 10Mbps', maxWidth: 1920, bitrate: 10000000 });
|
||||
options.push({ name: '1080p - 8Mbps', maxWidth: 1920, bitrate: 8000000 });
|
||||
options.push({ name: '1080p - 6Mbps', maxWidth: 1920, bitrate: 6000000 });
|
||||
options.push({ name: '1080p - 5Mbps', maxWidth: 1920, bitrate: 5000000 });
|
||||
}
|
||||
else if (maxAllowedWidth >= 1260) {
|
||||
options.push({ name: '720p - 10Mbps', maxWidth: 1280, bitrate: 10000000 });
|
||||
options.push({ name: '720p - 8Mbps', maxWidth: 1280, bitrate: 8000000 });
|
||||
options.push({ name: '720p - 6Mbps', maxWidth: 1280, bitrate: 6000000 });
|
||||
options.push({ name: '720p - 5Mbps', maxWidth: 1280, bitrate: 5000000 });
|
||||
}
|
||||
else if (maxAllowedWidth >= 460) {
|
||||
options.push({ name: '480p - 4Mbps', maxWidth: 720, bitrate: 4000000 });
|
||||
options.push({ name: '480p - 3Mbps', maxWidth: 720, bitrate: 3000000 });
|
||||
options.push({ name: '480p - 2.5Mbps', maxWidth: 720, bitrate: 2500000 });
|
||||
options.push({ name: '480p - 2Mbps', maxWidth: 720, bitrate: 2000000 });
|
||||
options.push({ name: '480p - 1.5Mbps', maxWidth: 720, bitrate: 1500000 });
|
||||
}
|
||||
|
||||
if (maxAllowedWidth >= 1260) {
|
||||
options.push({ name: '720p - 4Mbps', maxWidth: 1280, bitrate: 4000000 });
|
||||
options.push({ name: '720p - 3Mbps', maxWidth: 1280, bitrate: 3000000 });
|
||||
options.push({ name: '720p - 2Mbps', maxWidth: 1280, bitrate: 2000000 });
|
||||
|
||||
// The extra 1 is because they're keyed off the bitrate value
|
||||
options.push({ name: '720p - 1Mbps', maxWidth: 1280, bitrate: 1000001 });
|
||||
}
|
||||
|
||||
options.push({ name: '480p - 1.0Mbps', maxWidth: 720, bitrate: 1000000 });
|
||||
options.push({ name: '480p - 720kbps', maxWidth: 720, bitrate: 720000 });
|
||||
options.push({ name: '480p - 420kbps', maxWidth: 720, bitrate: 420000 });
|
||||
options.push({ name: '360p', maxWidth: 640, bitrate: 400000 });
|
||||
options.push({ name: '240p', maxWidth: 426, bitrate: 320000 });
|
||||
|
||||
var i, length, option;
|
||||
var selectedIndex = -1;
|
||||
for (i = 0, length = options.length; i < length; i++) {
|
||||
|
||||
option = options[i];
|
||||
|
||||
if (selectedIndex == -1 && option.bitrate <= bitrateSetting) {
|
||||
selectedIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedIndex == -1) {
|
||||
|
||||
selectedIndex = options.length - 1;
|
||||
}
|
||||
|
||||
options[selectedIndex].selected = true;
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
function bindEventsForPlayback() {
|
||||
|
||||
var hideElementsOnIdle = !$.browser.mobile;
|
||||
|
@ -1007,101 +927,20 @@
|
|||
}
|
||||
};
|
||||
|
||||
self.playVideo = function (playbackInfo, item, mediaSource, startPosition) {
|
||||
self.playVideo = function (item, mediaSource, startPosition) {
|
||||
|
||||
var streamInfo = self.createStreamInfo('video', item, mediaSource, startPosition);
|
||||
|
||||
var videoUrl = streamInfo.url;
|
||||
var contentType = streamInfo.contentType;
|
||||
var startPositionInSeekParam = streamInfo.startPositionInSeekParam;
|
||||
self.startTimeTicksOffset = streamInfo.startTimeTicksOffset;
|
||||
|
||||
var mediaStreams = mediaSource.MediaStreams || [];
|
||||
|
||||
var subtitleStreams = mediaStreams.filter(function (s) {
|
||||
return s.Type == 'Subtitle';
|
||||
});
|
||||
|
||||
var selectedSubtitleStream = subtitleStreams.filter(function (s) {
|
||||
return s.Index == mediaSource.DefaultSubtitleStreamIndex;
|
||||
|
||||
})[0];
|
||||
|
||||
var baseParams = {
|
||||
audioChannels: 2,
|
||||
StartTimeTicks: startPosition,
|
||||
AudioStreamIndex: mediaSource.DefaultAudioStreamIndex,
|
||||
deviceId: ApiClient.deviceId(),
|
||||
Static: false,
|
||||
mediaSourceId: mediaSource.Id,
|
||||
api_key: ApiClient.accessToken(),
|
||||
StreamId: playbackInfo.StreamId
|
||||
};
|
||||
|
||||
if (selectedSubtitleStream && (!self.supportsSubtitleStreamExternally(selectedSubtitleStream) || !self.supportsTextTracks())) {
|
||||
baseParams.SubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex;
|
||||
}
|
||||
|
||||
var mp4Quality = getVideoQualityOptions(mediaStreams).filter(function (opt) {
|
||||
return opt.selected;
|
||||
})[0];
|
||||
mp4Quality = $.extend(mp4Quality, self.getFinalVideoParams(mediaSource, mp4Quality.maxWidth, mp4Quality.bitrate, baseParams.AudioStreamIndex, baseParams.SubtitleStreamIndex, '.mp4'));
|
||||
|
||||
var webmQuality = getVideoQualityOptions(mediaStreams).filter(function (opt) {
|
||||
return opt.selected;
|
||||
})[0];
|
||||
webmQuality = $.extend(webmQuality, self.getFinalVideoParams(mediaSource, webmQuality.maxWidth, webmQuality.bitrate, baseParams.AudioStreamIndex, baseParams.SubtitleStreamIndex, '.webm'));
|
||||
|
||||
var m3U8Quality = getVideoQualityOptions(mediaStreams).filter(function (opt) {
|
||||
return opt.selected;
|
||||
})[0];
|
||||
m3U8Quality = $.extend(m3U8Quality, self.getFinalVideoParams(mediaSource, mp4Quality.maxWidth, mp4Quality.bitrate, baseParams.AudioStreamIndex, baseParams.SubtitleStreamIndex, '.mp4'));
|
||||
|
||||
var isStatic = mp4Quality.isStatic;
|
||||
|
||||
self.startTimeTicksOffset = isStatic ? 0 : startPosition || 0;
|
||||
|
||||
var startPositionInSeekParam = startPosition ? (startPosition / 10000000) : 0;
|
||||
var seekParam = startPositionInSeekParam ? '#t=' + startPositionInSeekParam : '';
|
||||
|
||||
var mp4VideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.mp4', $.extend({}, baseParams, {
|
||||
Static: isStatic,
|
||||
maxWidth: mp4Quality.maxWidth,
|
||||
videoBitrate: mp4Quality.videoBitrate,
|
||||
audioBitrate: mp4Quality.audioBitrate,
|
||||
VideoCodec: mp4Quality.videoCodec,
|
||||
AudioCodec: mp4Quality.audioCodec,
|
||||
profile: 'high',
|
||||
//EnableAutoStreamCopy: false,
|
||||
level: '41'
|
||||
}));
|
||||
|
||||
if (isStatic && mediaSource.Protocol == 'Http' && !mediaSource.RequiredHttpHeaders.length) {
|
||||
mp4VideoUrl = mediaSource.Path;
|
||||
}
|
||||
|
||||
if (isStatic) {
|
||||
mp4VideoUrl += seekParam;
|
||||
} else {
|
||||
mp4VideoUrl += "&StreamId=" + new Date().getTime();
|
||||
}
|
||||
|
||||
var webmVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/stream.webm', $.extend({}, baseParams, {
|
||||
VideoCodec: 'vpx',
|
||||
AudioCodec: 'Vorbis',
|
||||
maxWidth: webmQuality.maxWidth,
|
||||
videoBitrate: webmQuality.videoBitrate,
|
||||
audioBitrate: webmQuality.audioBitrate,
|
||||
EnableAutoStreamCopy: false,
|
||||
StreamId: new Date().getTime()
|
||||
}));
|
||||
|
||||
var hlsVideoUrl = ApiClient.getUrl('Videos/' + item.Id + '/master.m3u8', $.extend({}, baseParams, {
|
||||
maxWidth: m3U8Quality.maxWidth,
|
||||
videoBitrate: m3U8Quality.videoBitrate,
|
||||
audioBitrate: m3U8Quality.audioBitrate,
|
||||
VideoCodec: m3U8Quality.videoCodec,
|
||||
AudioCodec: m3U8Quality.audioCodec,
|
||||
profile: 'high',
|
||||
level: '41',
|
||||
StartTimeTicks: 0,
|
||||
StreamId: new Date().getTime()
|
||||
|
||||
})) + seekParam;
|
||||
|
||||
// Get Video Poster (Code from librarybrowser.js)
|
||||
var screenWidth = Math.max(screen.height, screen.width),
|
||||
posterCode = '';
|
||||
|
@ -1136,52 +975,26 @@
|
|||
|
||||
// Can't autoplay in these browsers so we need to use the full controls
|
||||
if (requiresNativeControls) {
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="none" autoplay="autoplay" controls="controls"' + posterCode + '>';
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="none" autoplay="autoplay" crossorigin="anonymous" controls="controls"' + posterCode + '>';
|
||||
} else {
|
||||
|
||||
// Chrome 35 won't play with preload none
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" autoplay' + posterCode + '>';
|
||||
html += '<video class="itemVideo" id="itemVideo" preload="metadata" crossorigin="anonymous" autoplay' + posterCode + '>';
|
||||
}
|
||||
|
||||
if (!isStatic) {
|
||||
// HLS must be at the top for safari
|
||||
html += '<source type="application/x-mpegURL" src="' + hlsVideoUrl + '" />';
|
||||
}
|
||||
html += '<source type="' + contentType + '" src="' + videoUrl + '" />';
|
||||
|
||||
var mp4BeforeWebm = self.getVideoTranscodingExtension() != '.webm';
|
||||
var textStreams = subtitleStreams.filter(function (s) {
|
||||
return s.DeliveryMethod == 'External';
|
||||
});
|
||||
|
||||
if (mp4BeforeWebm) {
|
||||
html += '<source type="video/mp4" src="' + mp4VideoUrl + '" />';
|
||||
}
|
||||
for (var i = 0, length = textStreams.length; i < length; i++) {
|
||||
|
||||
// Have to put webm ahead of mp4 because it will play in fast forward in chrome
|
||||
// And firefox doesn't like fragmented mp4
|
||||
if (!isStatic) {
|
||||
var textStream = textStreams[i];
|
||||
var textStreamUrl = !textStream.IsExternalUrl ? ApiClient.getUrl(textStream.DeliveryUrl) : textStream.DeliveryUrl;
|
||||
var defaultAttribute = textStream.Index == mediaSource.DefaultSubtitleStreamIndex ? ' default' : '';
|
||||
|
||||
html += '<source type="video/webm" src="' + webmVideoUrl + '" />';
|
||||
}
|
||||
|
||||
if (!mp4BeforeWebm) {
|
||||
html += '<source type="video/mp4" src="' + mp4VideoUrl + '" />';
|
||||
}
|
||||
|
||||
if (self.supportsTextTracks()) {
|
||||
var textStreams = subtitleStreams.filter(function (s) {
|
||||
return self.supportsSubtitleStreamExternally(s);
|
||||
});
|
||||
|
||||
for (var i = 0, length = textStreams.length; i < length; i++) {
|
||||
|
||||
var textStream = textStreams[i];
|
||||
var textStreamUrl = ApiClient.getUrl('Videos/' + item.Id + '/' + mediaSource.Id + '/Subtitles/' + textStream.Index + '/Stream.vtt', {
|
||||
startPositionTicks: (startPosition || 0),
|
||||
api_key: ApiClient.accessToken()
|
||||
});
|
||||
|
||||
var defaultAttribute = textStream.Index == mediaSource.DefaultSubtitleStreamIndex ? ' default' : '';
|
||||
|
||||
html += '<track kind="subtitles" src="' + textStreamUrl + '" srclang="' + (textStream.Language || 'und') + '"' + defaultAttribute + '></track>';
|
||||
}
|
||||
html += '<track kind="subtitles" src="' + textStreamUrl + '" srclang="' + (textStream.Language || 'und') + '"' + defaultAttribute + '></track>';
|
||||
}
|
||||
|
||||
html += '</video>';
|
||||
|
@ -1303,8 +1116,6 @@
|
|||
|
||||
self.stop();
|
||||
|
||||
console.dir(this);
|
||||
|
||||
var errorCode = this.error ? this.error.code : '';
|
||||
console.log('Html5 Video error code: ' + errorCode);
|
||||
|
||||
|
@ -1329,7 +1140,6 @@
|
|||
message: errorMsg
|
||||
});
|
||||
|
||||
|
||||
}).on("click.mediaplayerevent", function (e) {
|
||||
|
||||
if (this.paused) {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -74,6 +74,17 @@
|
|||
lazy: true
|
||||
});
|
||||
}
|
||||
else if (view == "Thumb") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "backdrop",
|
||||
context: 'movies',
|
||||
showTitle: true,
|
||||
centerText: true,
|
||||
lazy: true,
|
||||
preferThumb: true
|
||||
});
|
||||
}
|
||||
|
||||
$('.noItemsMessage', page).hide();
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated,SyncInfo",
|
||||
Fields: "DateCreated,SyncInfo,ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Movie,Trailer",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated",
|
||||
Fields: "DateCreated,ItemCounts",
|
||||
PersonTypes: "",
|
||||
StartIndex: 0,
|
||||
Limit: 100
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
(function ($, document) {
|
||||
|
||||
$(document).on('pagebeforeshow', "#moviesLatestPage", function () {
|
||||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var page = this;
|
||||
|
||||
var options = {
|
||||
|
||||
IncludeItemTypes: "Movie",
|
||||
Limit: 30,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: items,
|
||||
lazy: true,
|
||||
shape: 'portrait',
|
||||
overlayText: false
|
||||
|
||||
})).lazyChildren().trigger('create');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
})(jQuery, document);
|
|
@ -1,5 +1,29 @@
|
|||
(function ($, document) {
|
||||
|
||||
function loadLatest(page, userId, parentId) {
|
||||
|
||||
var options = {
|
||||
|
||||
IncludeItemTypes: "Movie",
|
||||
Limit: 20,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
ParentId: parentId,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: items,
|
||||
lazy: true,
|
||||
shape: 'portrait',
|
||||
overlayText: false
|
||||
|
||||
})).lazyChildren().trigger('create');
|
||||
});
|
||||
}
|
||||
|
||||
function getRecommendationHtml(recommendation) {
|
||||
|
||||
var html = '';
|
||||
|
@ -51,6 +75,7 @@
|
|||
var screenWidth = $(window).width();
|
||||
|
||||
var page = this;
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var options = {
|
||||
|
||||
|
@ -58,7 +83,7 @@
|
|||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Filters: "IsResumable",
|
||||
Limit: screenWidth >= 1920 ? 12 : (screenWidth >= 1600 ? 8 : 6),
|
||||
Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1600 ? 4 : 3),
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
CollapseBoxSetItems: false,
|
||||
|
@ -67,7 +92,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
|
@ -87,9 +112,11 @@
|
|||
|
||||
});
|
||||
|
||||
loadLatest(page, userId, parentId);
|
||||
|
||||
var url = ApiClient.getUrl("Movies/Recommendations", {
|
||||
|
||||
userId: Dashboard.getCurrentUserId(),
|
||||
userId: userId,
|
||||
categoryLimit: screenWidth >= 1200 ? 4 : 3,
|
||||
ItemLimit: screenWidth >= 1920 ? 10 : (screenWidth >= 1600 ? 8 : (screenWidth >= 1200 ? 7 : 6)),
|
||||
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Movie",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated",
|
||||
Fields: "DateCreated,ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
SortBy: "SortName",
|
||||
SortOrder: "Ascending",
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SortName,DateCreated,SyncInfo",
|
||||
Fields: "PrimaryImageAspectRatio,SortName,DateCreated,SyncInfo,ItemCounts",
|
||||
StartIndex: 0,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
SortBy: "SortName",
|
||||
SortOrder: "Ascending",
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SortName,DateCreated,SyncInfo",
|
||||
Fields: "PrimaryImageAspectRatio,SortName,DateCreated,SyncInfo,ItemCounts",
|
||||
StartIndex: 0,
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Audio,MusicVideo",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated,SyncInfo",
|
||||
Fields: "DateCreated,SyncInfo,ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -133,6 +133,8 @@
|
|||
$('#chkDisplayCollectionView', page).checked(user.Configuration.DisplayCollectionsView || false).checkboxradio("refresh");
|
||||
$('#chkDisplayFolderView', page).checked(user.Configuration.DisplayFoldersView || false).checkboxradio("refresh");
|
||||
|
||||
$('#chkHidePlayedFromLatest', page).checked(user.Configuration.HidePlayedInLatest || false).checkboxradio("refresh");
|
||||
|
||||
var promise1 = ApiClient.getItems(user.Id, {
|
||||
sortBy: "SortName"
|
||||
});
|
||||
|
@ -163,6 +165,8 @@
|
|||
user.Configuration.DisplayCollectionsView = $('#chkDisplayCollectionView', page).checked();
|
||||
user.Configuration.DisplayFoldersView = $('#chkDisplayFolderView', page).checked();
|
||||
|
||||
user.Configuration.HidePlayedInLatest = $('#chkHidePlayedFromLatest', page).checked();
|
||||
|
||||
user.Configuration.IncludeTrailersInSuggestions = $('#chkDisplayTrailersWithinMovieSuggestions', page).checked();
|
||||
|
||||
user.Configuration.LatestItemsExcludes = $(".chkIncludeInLatest:not(:checked)", page).get().map(function (i) {
|
||||
|
|
|
@ -185,8 +185,7 @@ var Dashboard = {
|
|||
var url = getWindowUrl().toLowerCase();
|
||||
|
||||
return url.indexOf('mediabrowser.tv') != -1 ||
|
||||
url.indexOf('emby.media') != -1 ||
|
||||
url.indexOf('mediabrowser.github') != -1;
|
||||
url.indexOf('emby.media') != -1;
|
||||
},
|
||||
|
||||
logout: function (logoutWithServer) {
|
||||
|
@ -756,6 +755,9 @@ var Dashboard = {
|
|||
|
||||
var pageElem = page[0];
|
||||
|
||||
var isServicesPage = page.hasClass('appServicesPage');
|
||||
var context = getParameterByName('context');
|
||||
|
||||
return [{
|
||||
name: Globalize.translate('TabServer'),
|
||||
href: "dashboard.html",
|
||||
|
@ -793,7 +795,7 @@ var Dashboard = {
|
|||
}, {
|
||||
name: Globalize.translate('TabSync'),
|
||||
href: "syncactivity.html",
|
||||
selected: page.hasClass('syncConfigurationPage'),
|
||||
selected: page.hasClass('syncConfigurationPage') || (isServicesPage && context == 'sync'),
|
||||
icon: 'fa-cloud'
|
||||
}, {
|
||||
divider: true,
|
||||
|
@ -813,7 +815,7 @@ var Dashboard = {
|
|||
}, {
|
||||
name: Globalize.translate('TabLiveTV'),
|
||||
href: "livetvstatus.html",
|
||||
selected: page.hasClass("liveTvSettingsPage"),
|
||||
selected: page.hasClass("liveTvSettingsPage") || (isServicesPage && context == 'livetv'),
|
||||
icon: 'fa-video-camera',
|
||||
color: '#293AAE'
|
||||
}, {
|
||||
|
@ -1352,7 +1354,9 @@ var Dashboard = {
|
|||
});
|
||||
|
||||
if (!Dashboard.isServerlessPage()) {
|
||||
|
||||
if (Dashboard.serverAddress() && Dashboard.getCurrentUserId() && Dashboard.getAccessToken()) {
|
||||
|
||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||
|
||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||
|
@ -1361,6 +1365,7 @@ var Dashboard = {
|
|||
|
||||
ConnectionManager.addApiClient(ApiClient, true).fail(Dashboard.logout);
|
||||
} else {
|
||||
|
||||
Dashboard.logout();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -43,10 +43,10 @@
|
|||
return $(".radioDonationType:checked", page).val();
|
||||
}
|
||||
|
||||
var lifeTimeAmount = 40;
|
||||
var lifeTimeAmount = 59;
|
||||
var dailyAmount = 1;
|
||||
var monthlyAmount = 4;
|
||||
var yearlyAmount = 28;
|
||||
var yearlyAmount = 32;
|
||||
function getDonationAmount(page) {
|
||||
|
||||
var type = getDonationType(page);
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
(function ($, document) {
|
||||
|
||||
function reloadList(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var promise1 = ApiClient.getAvailablePlugins({
|
||||
TargetSystems: 'Server'
|
||||
});
|
||||
|
||||
var promise2 = ApiClient.getInstalledPlugins();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
renderInstalled(page, response1[0], response2[0]);
|
||||
renderCatalog(page, response1[0], response2[0]);
|
||||
});
|
||||
}
|
||||
|
||||
function renderInstalled(page, availablePlugins, installedPlugins) {
|
||||
|
||||
installedPlugins = installedPlugins.filter(function (i) {
|
||||
|
||||
var catalogEntry = availablePlugins.filter(function (a) {
|
||||
return a.guid == i.Id;
|
||||
})[0];
|
||||
|
||||
return catalogEntry && catalogEntry.category == 'Sync';
|
||||
|
||||
});
|
||||
|
||||
PluginsPage.renderPlugins(page, installedPlugins);
|
||||
}
|
||||
|
||||
function renderCatalog(page, availablePlugins, installedPlugins) {
|
||||
|
||||
PluginCatalog.renderCatalog({
|
||||
|
||||
catalogElement: $('.catalog', page),
|
||||
availablePlugins: availablePlugins,
|
||||
installedPlugins: installedPlugins,
|
||||
categories: ['Sync'],
|
||||
showCategory: false,
|
||||
context: 'sync',
|
||||
targetSystem: 'Server'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#syncServicesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reloadList(page);
|
||||
|
||||
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
$('.syncPromotion', page).hide();
|
||||
} else {
|
||||
$('.syncPromotion', page).show();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, document);
|
|
@ -113,7 +113,7 @@ $.fn.taskButton = function (options) {
|
|||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (this.length) {
|
||||
|
||||
this.on('click.taskbutton', function () {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Series",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated,SyncInfo",
|
||||
Fields: "DateCreated,SyncInfo,ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Series,Episode",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated",
|
||||
Fields: "DateCreated,ItemCounts",
|
||||
PersonTypes: "",
|
||||
StartIndex: 0,
|
||||
Limit: 100
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
SortOrder: "Ascending",
|
||||
IncludeItemTypes: "Series",
|
||||
Recursive: true,
|
||||
Fields: "DateCreated",
|
||||
Fields: "DateCreated,ItemCounts",
|
||||
StartIndex: 0
|
||||
};
|
||||
|
||||
|
|
|
@ -14,12 +14,7 @@
|
|||
|
||||
var id = 'mediaFolder' + i;
|
||||
|
||||
var isChecked;
|
||||
if (user.Policy.BlockedMediaFolders != null) {
|
||||
isChecked = user.Policy.BlockedMediaFolders.indexOf(folder.Id) == -1 && user.Policy.BlockedMediaFolders.indexOf(folder.Name) == -1;
|
||||
} else {
|
||||
isChecked = user.Policy.EnableAllFolders || user.Policy.EnabledFolders.indexOf(folder.Id) != -1;
|
||||
}
|
||||
var isChecked = user.Policy.EnableAllFolders || user.Policy.EnabledFolders.indexOf(folder.Id) != -1;
|
||||
var checkedAttribute = isChecked ? ' checked="checked"' : '';
|
||||
|
||||
html += '<input class="chkFolder" data-id="' + folder.Id + '" type="checkbox" id="' + id + '"' + checkedAttribute + ' />';
|
||||
|
@ -30,11 +25,7 @@
|
|||
|
||||
$('.folderAccess', page).html(html).trigger('create');
|
||||
|
||||
if (user.Policy.BlockedMediaFolders != null) {
|
||||
$('#chkEnableAllFolders', page).checked(user.Policy.BlockedMediaFolders.length == 0).checkboxradio('refresh').trigger('change');
|
||||
} else {
|
||||
$('#chkEnableAllFolders', page).checked(user.Policy.EnableAllFolders).checkboxradio('refresh').trigger('change');
|
||||
}
|
||||
$('#chkEnableAllFolders', page).checked(user.Policy.EnableAllFolders).checkboxradio('refresh').trigger('change');
|
||||
}
|
||||
|
||||
function loadChannels(page, user, channels) {
|
||||
|
@ -51,12 +42,7 @@
|
|||
|
||||
var id = 'channels' + i;
|
||||
|
||||
var isChecked;
|
||||
if (user.Policy.BlockedChannels != null) {
|
||||
isChecked = user.Policy.BlockedChannels.indexOf(folder.Id) == -1;
|
||||
} else {
|
||||
isChecked = user.Policy.EnableAllChannels || user.Policy.EnabledChannels.indexOf(folder.Id) != -1;
|
||||
}
|
||||
var isChecked = user.Policy.EnableAllChannels || user.Policy.EnabledChannels.indexOf(folder.Id) != -1;
|
||||
var checkedAttribute = isChecked ? ' checked="checked"' : '';
|
||||
|
||||
html += '<input class="chkChannel" data-id="' + folder.Id + '" type="checkbox" id="' + id + '"' + checkedAttribute + ' />';
|
||||
|
@ -73,11 +59,7 @@
|
|||
$('.channelAccessContainer', page).hide();
|
||||
}
|
||||
|
||||
if (user.Policy.BlockedChannels != null) {
|
||||
$('#chkEnableAllChannels', page).checked(user.Policy.BlockedChannels.length == 0).checkboxradio('refresh').trigger('change');
|
||||
} else {
|
||||
$('#chkEnableAllChannels', page).checked(user.Policy.EnableAllChannels).checkboxradio('refresh').trigger('change');
|
||||
}
|
||||
$('#chkEnableAllChannels', page).checked(user.Policy.EnableAllChannels).checkboxradio('refresh').trigger('change');
|
||||
}
|
||||
|
||||
function loadDevices(page, user, devices) {
|
||||
|
@ -140,7 +122,6 @@
|
|||
return this.getAttribute('data-id');
|
||||
|
||||
}).get();
|
||||
user.Policy.BlockedMediaFolders = null;
|
||||
|
||||
user.Policy.EnableAllChannels = $('#chkEnableAllChannels', page).checked();
|
||||
user.Policy.EnabledChannels = user.Policy.EnableAllChannels ?
|
||||
|
@ -150,7 +131,6 @@
|
|||
return this.getAttribute('data-id');
|
||||
|
||||
}).get();
|
||||
user.Policy.BlockedChannels = null;
|
||||
|
||||
user.Policy.EnableAllDevices = $('#chkEnableAllDevices', page).checked();
|
||||
user.Policy.EnabledDevices = user.Policy.EnableAllDevices ?
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
itemHtml += '<li class="liSchedule" data-day="' + a.DayOfWeek + '" data-start="' + a.StartHour + '" data-end="' + a.EndHour + '">';
|
||||
|
||||
itemHtml += '<a href="#">';
|
||||
itemHtml += '<h3>' + a.DayOfWeek + '</h3>';
|
||||
itemHtml += '<h3>' + Globalize.translate('Option' + a.DayOfWeek) + '</h3>';
|
||||
itemHtml += '<p>' + getDisplayTime(a.StartHour) + ' - ' + getDisplayTime(a.EndHour) + '</p>';
|
||||
itemHtml += '</a>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue