From 3842bf80e69a91740cf9a4b3f1ff8bf32f8b71d9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 4 Sep 2016 11:01:31 -0400 Subject: [PATCH] add configurable encoding params --- .../cardbuilder/cardbuilder.js | 2 +- .../components/dockedtabs/dockedtabs.css | 2 + .../components/dockedtabs/dockedtabs.js | 11 +++- dashboard-ui/css/dashboard.css | 5 -- dashboard-ui/css/librarymenu.css | 6 ++- dashboard-ui/devices/ios/ios.css | 4 -- dashboard-ui/encodingsettings.html | 22 +++++++- dashboard-ui/livetv.html | 15 ++++-- dashboard-ui/scripts/encodingsettings.js | 6 +++ dashboard-ui/scripts/livetvrecordings.js | 14 ----- dashboard-ui/scripts/livetvschedule.js | 53 +++++++++++++++++++ dashboard-ui/scripts/livetvsuggested.js | 8 ++- dashboard-ui/strings/en-US.json | 6 ++- 13 files changed, 119 insertions(+), 35 deletions(-) create mode 100644 dashboard-ui/scripts/livetvschedule.js diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 1b35b857ac..0dfaa25f77 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -1036,7 +1036,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (options.coverImage || imgInfo.coverImage) { cardImageContainerClass += ' coveredImage'; - if (item.MediaType == 'Photo' || item.Type == 'PhotoAlbum' || item.Type == 'Folder') { + if (item.MediaType == 'Photo' || item.Type == 'PhotoAlbum' || item.Type == 'Folder' || item.Type == 'Program') { cardImageContainerClass += ' coveredImage-noScale'; } } diff --git a/dashboard-ui/components/dockedtabs/dockedtabs.css b/dashboard-ui/components/dockedtabs/dockedtabs.css index 4dc65f2ba0..a1195193bb 100644 --- a/dashboard-ui/components/dockedtabs/dockedtabs.css +++ b/dashboard-ui/components/dockedtabs/dockedtabs.css @@ -2,6 +2,8 @@ flex-grow: 1; display: flex; padding: .5em 0; + /* Override size from librarymenu */ + font-size: inherit; } .dockedtabs-tab-button { diff --git a/dashboard-ui/components/dockedtabs/dockedtabs.js b/dashboard-ui/components/dockedtabs/dockedtabs.js index b0a0a2d942..1d36803f90 100644 --- a/dashboard-ui/components/dockedtabs/dockedtabs.js +++ b/dashboard-ui/components/dockedtabs/dockedtabs.js @@ -226,7 +226,7 @@ '; if (appHost.supports('sync')) { - html += '\ '; @@ -270,6 +270,15 @@ element.querySelector('.docked-tab-livetv').classList.add('hide'); } + var downloadsTab = element.querySelector('.docked-tab-syncdownloads'); + if (downloadsTab) { + if (user.Policy.EnableSync) { + downloadsTab.classList.remove('hide'); + } else { + downloadsTab.classList.add('hide'); + } + } + if (user.Policy.IsAdministrator) { element.querySelector('.docked-tab-manageserver').classList.remove('hide'); } else { diff --git a/dashboard-ui/css/dashboard.css b/dashboard-ui/css/dashboard.css index a4841f05a8..66f8229ba8 100644 --- a/dashboard-ui/css/dashboard.css +++ b/dashboard-ui/css/dashboard.css @@ -86,11 +86,6 @@ display: none !important; } - .dashboardDocument .libraryMenuButtonText { - font-size: 125%; - margin-left: 0; - } - .dashboardDocument .mainDrawerPanelContent { position: absolute; top: 0; diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 27d7efb341..9314405bd3 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -87,7 +87,6 @@ align-items: center; margin-left: .75em; font-size: 108%; - /* Avoid pushing right header off the screen */ flex-shrink: 1; } @@ -103,6 +102,7 @@ height: 50px; display: flex; flex-direction: column; + font-size: 13px; } .hiddenViewMenuBar .viewMenuBar { @@ -123,6 +123,10 @@ align-items: center; } +.emby-tabs { + font-size: 13px; +} + .ui-body-b .libraryViewNav { box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),1px 5px 1px rgba(0,0,0,.12); position: fixed; diff --git a/dashboard-ui/devices/ios/ios.css b/dashboard-ui/devices/ios/ios.css index 771dbed9b2..f5611a9aac 100644 --- a/dashboard-ui/devices/ios/ios.css +++ b/dashboard-ui/devices/ios/ios.css @@ -43,10 +43,6 @@ body:not(.dashboardDocument) .mainDrawerButton { display: none; } -.libraryViewNav { - font-size: 12px; -} - h1, h1 a { font-weight: 400 !important; } diff --git a/dashboard-ui/encodingsettings.html b/dashboard-ui/encodingsettings.html index cdd1de49b0..5e98c03d99 100644 --- a/dashboard-ui/encodingsettings.html +++ b/dashboard-ui/encodingsettings.html @@ -16,7 +16,7 @@
${LabelHardwareAccelerationTypeHelp}
- +
${LabelVaapiDeviceHelp}
@@ -73,6 +73,26 @@
${LabelDownMixAudioScaleHelp}
+
+ +
${H264EncodingPresetHelp}
+
+
+ +
${H264CrfHelp}
+
+
diff --git a/dashboard-ui/livetv.html b/dashboard-ui/livetv.html index e6d356b09c..048e31e54b 100644 --- a/dashboard-ui/livetv.html +++ b/dashboard-ui/livetv.html @@ -15,6 +15,9 @@
${TabRecordings}
+ @@ -82,10 +85,6 @@

-
-
-
-

${HeaderAllRecordings}

@@ -94,7 +93,13 @@
-
+
+
+
+
+
+
+
diff --git a/dashboard-ui/scripts/encodingsettings.js b/dashboard-ui/scripts/encodingsettings.js index 7495110f7e..8dc8f675ee 100644 --- a/dashboard-ui/scripts/encodingsettings.js +++ b/dashboard-ui/scripts/encodingsettings.js @@ -11,6 +11,9 @@ $('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || ''); $('#txtVaapiDevice', page).val(config.VaapiDevice || ''); + page.querySelector('#selectH264Preset').value = config.H264Preset || ''; + page.querySelector('#txtH264Crf').value = config.H264Crf || ''; + var selectEncoderPath = page.querySelector('#selectEncoderPath'); selectEncoderPath.value = systemInfo.EncoderLocationType; @@ -71,6 +74,9 @@ config.HardwareAccelerationType = $('#selectVideoDecoder', form).val(); config.VaapiDevice = $('#txtVaapiDevice', form).val(); + config.H264Preset = form.querySelector('#selectH264Preset').value; + config.H264Crf = parseInt(form.querySelector('#txtH264Crf').value || '0'); + config.EnableThrottling = form.querySelector('#chkEnableThrottle').checked; ApiClient.updateNamedConfiguration("encoding", config).then(function () { diff --git a/dashboard-ui/scripts/livetvrecordings.js b/dashboard-ui/scripts/livetvrecordings.js index 2550b970b2..2697b4d42d 100644 --- a/dashboard-ui/scripts/livetvrecordings.js +++ b/dashboard-ui/scripts/livetvrecordings.js @@ -155,21 +155,10 @@ }); } - function renderUpcomingRecordings(context) { - - ApiClient.getLiveTvTimers({ - IsActive: false - }).then(function (result) { - - renderTimers(context.querySelector('#upcomingRecordings'), result.Items); - }); - } - function reload(context) { Dashboard.showLoadingMsg(); - renderUpcomingRecordings(context); renderActiveRecordings(context); renderLatestRecordings(context); @@ -191,9 +180,6 @@ tabContent.querySelector('#activeRecordings .recordingItems').addEventListener('timercancelled', function () { reload(tabContent); }); - tabContent.querySelector('#upcomingRecordings .recordingItems').addEventListener('timercancelled', function () { - reload(tabContent); - }); self.renderTab = function () { reload(tabContent); diff --git a/dashboard-ui/scripts/livetvschedule.js b/dashboard-ui/scripts/livetvschedule.js new file mode 100644 index 0000000000..01929ce34a --- /dev/null +++ b/dashboard-ui/scripts/livetvschedule.js @@ -0,0 +1,53 @@ +define(['components/categorysyncbuttons', 'cardBuilder', 'scripts/livetvcomponents', 'emby-button', 'listViewStyle', 'emby-itemscontainer'], function (categorysyncbuttons, cardBuilder) { + + function renderTimers(context, timers, options) { + + LiveTvHelpers.getTimersHtml(timers, options).then(function (html) { + + var elem = context; + + if (html) { + elem.classList.remove('hide'); + } else { + elem.classList.add('hide'); + } + + elem.querySelector('.recordingItems').innerHTML = html; + + ImageLoader.lazyChildren(elem); + }); + } + + function renderUpcomingRecordings(context) { + + ApiClient.getLiveTvTimers({ + IsActive: false + }).then(function (result) { + + renderTimers(context.querySelector('#upcomingRecordings'), result.Items); + Dashboard.hideLoadingMsg(); + }); + } + + function reload(context) { + + Dashboard.showLoadingMsg(); + + renderUpcomingRecordings(context); + } + + return function (view, params, tabContent) { + + var self = this; + + categorysyncbuttons.init(tabContent); + tabContent.querySelector('#upcomingRecordings .recordingItems').addEventListener('timercancelled', function () { + reload(tabContent); + }); + + self.renderTab = function () { + reload(tabContent); + }; + }; + +}); \ No newline at end of file diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js index 3427bc0a7e..c20e4ee016 100644 --- a/dashboard-ui/scripts/livetvsuggested.js +++ b/dashboard-ui/scripts/livetvsuggested.js @@ -101,7 +101,7 @@ var html = cardBuilder.getCardsHtml({ items: items, - shape: shape || (enableScrollX() ? 'autooverflow' : 'auto'), + shape: shape || (enableScrollX() ? 'overflowBackdrop' : 'backdrop'), showTitle: true, centerText: true, coverImage: true, @@ -169,6 +169,10 @@ depends.push('scripts/livetvrecordings'); break; case 4: + document.body.classList.remove('autoScrollY'); + depends.push('scripts/livetvschedule'); + break; + case 5: document.body.classList.remove('autoScrollY'); depends.push('scripts/livetvseriestimers'); break; @@ -200,7 +204,7 @@ var viewTabs = view.querySelector('.libraryViewNav'); - libraryBrowser.configurePaperLibraryTabs(view, viewTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4]); + libraryBrowser.configurePaperLibraryTabs(view, viewTabs, view.querySelectorAll('.pageTabContent'), [0, 2, 3, 4, 5]); viewTabs.addEventListener('tabchange', function (e) { loadTab(view, parseInt(e.detail.selectedTabIndex)); diff --git a/dashboard-ui/strings/en-US.json b/dashboard-ui/strings/en-US.json index 7943dcf244..37f800ab42 100644 --- a/dashboard-ui/strings/en-US.json +++ b/dashboard-ui/strings/en-US.json @@ -2127,5 +2127,9 @@ "OptionExtractChapterImage": "Enable chapter image extraction", "Downloads": "Downloads", "OptionEnableExternalContentInSuggestions": "Enable external content in suggestions", - "OptionEnableExternalContentInSuggestionsHelp": "Allow internet trailers and live tv programs to be included within suggested content." + "OptionEnableExternalContentInSuggestionsHelp": "Allow internet trailers and live tv programs to be included within suggested content.", + "LabelH264EncodingPreset": "H264 encoding preset:", + "H264EncodingPresetHelp": "Choose a faster value to improve performance, or a slower value to improve quality.", + "LabelH264Crf": "H264 encoding CRF:", + "H264CrfHelp": "The Constant Rate Factor (CRF) is the default quality setting for the x264 encoder. You can set the values between 0 and 51, where lower values would result in better quality (at the expense of higher file sizes). Sane values are between 18 and 28. The default for x264 is 23, so you can use this as a starting point." }