diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index fd203d4fa0..5c5bcc32b7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -14,12 +14,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.362", - "_release": "1.4.362", + "version": "1.4.363", + "_release": "1.4.363", "_resolution": { "type": "version", - "tag": "1.4.362", - "commit": "74f60991dce95403508b7eb84ec362226f574bc9" + "tag": "1.4.363", + "commit": "391923397ea7ea23890ced20153fc896e8892f31" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.1", diff --git a/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js b/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js index f684bc41a5..3c4cbdc7ef 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/images/imagehelper.js @@ -111,7 +111,7 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings', //var now = new Date().getTime(); getVibrantInfoFromElement(img, url).then(function (vibrantInfo) { - + var swatch = vibrantInfo.split('|'); //console.log('vibrant took ' + (new Date().getTime() - now) + 'ms'); if (swatch.length) { @@ -133,18 +133,22 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings', } function getVibrantInfoFromElement(elem, url) { - - if (elem.tagName === 'IMG') { - return Promise.resolve(getVibrantInfo(elem, url)); - } return new Promise(function (resolve, reject) { - var img = new Image(); - img.onload = function () { - resolve(getVibrantInfo(img, url)); - }; - img.src = url; + require(['vibrant'], function () { + + if (elem.tagName === 'IMG') { + resolve(getVibrantInfo(elem, url)); + return; + } + + var img = new Image(); + img.onload = function () { + resolve(getVibrantInfo(img, url)); + }; + img.src = url; + }); }); } @@ -157,7 +161,7 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings', url = url.split('?')[0]; - var cacheKey = 'vibrant25'; + var cacheKey = 'vibrant31'; //cacheKey = 'vibrant' + new Date().getTime(); return cacheKey + url; } @@ -179,33 +183,21 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings', value = ''; var swatch = swatches.DarkVibrant; - if (swatch) { - value += swatch.getHex() + '|' + swatch.getBodyTextColor(); - } - //swatch = swatches.DarkMuted; - //if (swatch) { - // value += '|' + swatch.getHex() + '|' + swatch.getBodyTextColor(); - //} else { - // value += '||'; - //} - //swatch = swatches.Vibrant; - //if (swatch) { - // value += '|' + swatch.getHex() + '|' + swatch.getBodyTextColor(); - //} else { - // value += '||'; - //} - //swatch = swatches.Muted; - //if (swatch) { - // value += '|' + swatch.getHex() + '|' + swatch.getBodyTextColor(); - //} else { - // value += '||'; - //} + value += getSwatchString(swatch); appSettings.set(getSettingsKey(url), value); return value; } + function getSwatchString(swatch) { + + if (swatch) { + return swatch.getHex() + '|' + swatch.getBodyTextColor() + '|' + swatch.getTitleTextColor(); + } + return '||'; + } + function fadeIn(elem) { var duration = layoutManager.tv ? 160 : 300; @@ -294,6 +286,7 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings', self.lazyChildren = lazyChildren; self.getPrimaryImageAspectRatio = getPrimaryImageAspectRatio; self.getCachedVibrantInfo = getCachedVibrantInfo; + self.getVibrantInfoFromElement = getVibrantInfoFromElement; return self; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index 485d59d513..7c574d471e 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -174,7 +174,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } } - if (item.Type === 'Program') { + if (item.Type === 'Program' && options.record !== false) { commands.push({ name: Globalize.translate('sharedcomponents#Record'), @@ -184,7 +184,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', if (user.Policy.IsAdministrator) { - if (item.Type !== 'Timer' && item.Type !== 'SeriesTimer' && item.Type !== 'Program' && !(item.Type === 'Recording' && item.Status !== 'Completed')) { + if (item.Type !== 'Timer' && item.Type !== 'SeriesTimer' && item.Type !== 'Program' && item.Type !== 'TvChannel' && !(item.Type === 'Recording' && item.Status !== 'Completed')) { commands.push({ name: globalize.translate('sharedcomponents#Refresh'), id: 'refresh' diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js index 94a863dffb..98b9e9613a 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js @@ -71,6 +71,9 @@ define(['apphost'], function (appHost) { if (item.Type === 'Program') { return false; } + if (item.Type === 'TvChannel') { + return false; + } if (item.Type === 'Timer') { return false; } @@ -169,6 +172,12 @@ define(['apphost'], function (appHost) { canShare: function (user, item) { + if (item.Type === 'Program') { + return false; + } + if (item.Type === 'TvChannel') { + return false; + } if (item.Type === 'Timer') { return false; } diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index f73e6d1cc7..a11530786b 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -12,7 +12,7 @@ } .background-theme-b .backgroundContainer.withBackdrop { - background-color: rgba(6, 6,6, .9); + background-color: rgba(6, 6,6, .76); } .ui-body-b { @@ -31,6 +31,11 @@ right: 0; bottom: 0; z-index: -1; + -webkit-filter: blur(20px); + -moz-filter: blur(20px); + -o-filter: blur(20px); + -ms-filter: blur(20px); + filter: blur(20px); } .libraryPage .header { @@ -150,7 +155,7 @@ } .detailPageContent { - margin: 0 auto; + margin: 3em auto 0; padding: 0; border-spacing: 0; border-collapse: collapse; @@ -243,14 +248,10 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { background-size: cover; background-position: center 15%; background-repeat: no-repeat; - height: 640px; + height: 300px; position: relative; } -.smallBackdrop { - height: 500px; -} - .noSecondaryNavPage .itemBackdrop { margin-top: -50px; } @@ -278,40 +279,69 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { background-color: transparent; } -.detailNameContainer { - margin-top: -120px; - height: 110px; -} - .desktopMiscInfoContainer { position: absolute; bottom: 10px; } -.lnkSibling { - position: absolute; - bottom: 0; - text-decoration: none; - font-weight: normal !important; - display: none; - background-color: rgba(0,0,0,0.6); - color: #ddd !important; - background-color: transparent; - padding: 0; -} - - .lnkSibling:not(.hide) { - display: block; - } - .detailUserDataIcons { display: inline-block; + margin-left: .5em; } -@media all and (min-width: 540px) { +.detailImageContainer { + margin-right: 2em; +} - .detailUserDataIcons { - margin-left: .5em; +.itemDetailImage { + border: solid 1px transparent; + width: 280px; +} + +.thumbDetailImageContainer .itemDetailImage { + width: 400px; +} + +.itemDetailImage.loaded { + -moz-box-shadow: 0px 0 20px #000; + -webkit-box-shadow: 0px 0 20px #000; + box-shadow: 0px 0 20px #000; + border: solid 1px #222; +} + +.itemDetailGalleryLink img:hover { + -moz-box-shadow: 0 0 20px 3px #52B54B; + -webkit-box-shadow: 0 0 20px 3px #52B54B; + box-shadow: 0 0 20px 3px #52B54B; +} + +@media all and (max-width: 800px) { + + .detailImageContainer { + position: absolute; + top: 210px; + left: 3%; + } + + .itemDetailImage { + height: 120px; + width: auto!important; + } + + .btnPlaySimple { + display: none !important; + } +} + +@media all and (min-width: 800px) { + + .itemBackdrop { + display: none; + } + + .detailPagePrimaryContainer { + display: flex; + margin-bottom: 3em; } } @@ -322,64 +352,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { } } -.lnkPreviousItem { - left: 10px; -} - -.lnkNextItem { - right: 10px; -} - -.detailImageContainer { - float: left; - margin-top: -140px; -} - -.itemDetailImage { - border: solid 1px transparent; -} - - .itemDetailImage.loaded { - -moz-box-shadow: 0px 0 20px #000; - -webkit-box-shadow: 0px 0 20px #000; - box-shadow: 0px 0 20px #000; - border: solid 1px #222; - } - -.detailImageContainer img { - width: 280px; - /* This is just to make sure it always takes up some space */ - min-height: 140px; -} - -.portraitDetailImageContainer img { - width: 220px; -} - -.squareDetailImageContainer { - margin-top: -150px; -} - -.thumbDetailImageContainer { - margin-top: -130px; -} - -.itemDetailGalleryLink img:hover { - -moz-box-shadow: 0 0 20px 3px #52B54B; - -webkit-box-shadow: 0 0 20px 3px #52B54B; - box-shadow: 0 0 20px 3px #52B54B; -} - -.primaryDetailsContainer { - float: left; - padding: .75em 0 0 1.5em; - width: 66%; -} - -.portraitDetailImageContainer + .primaryDetailsContainer { - width: 74%; -} - .parentName { display: block; margin-bottom: .5em; @@ -388,9 +360,9 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { .emby-button.detailFloatingButton { width: 56px !important; height: 56px !important; - top: -28px; + bottom: -28px; position: absolute; - right: 25%; + right: 5%; background-color: #52B54B !important; } @@ -398,77 +370,25 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { background-color: #cc3333 !important; } -@media all and (max-width: 1000px) { - - .primaryDetailsContainer { - width: 64%; - } - - .portraitDetailImageContainer + .primaryDetailsContainer { - width: 72%; - } - - .detailImageContainer img { - width: 240px; - /* This is just to make sure it always takes up some space */ - min-height: 120px; - } - - .portraitDetailImageContainer img { - width: 180px; - } +.textLinkList a { + margin: 0 .5em; } + .textLinkList a:first-child { + margin-left: 0; + } + @media all and (max-width: 800px) { .parentName { margin-bottom: 1em; } - .primaryDetailsContainer { - padding-top: 2.5em; - padding-left: 1em; - } - - .detailNameContainer { - margin-top: auto; - height: auto; - } - .itemBackdropContent { min-height: 0; } } -@media all and (max-width: 600px) { - - .detailFloatingButton { - right: 15px !important; - } -} - -@media all and (max-width: 600px) { - - .primaryDetailsContainer { - width: 68%; - } - - .portraitDetailImageContainer + .primaryDetailsContainer { - width: 68%; - } -} - -@media all and (max-width: 400px) { - - .primaryDetailsContainer { - width: 60%; - } - - .portraitDetailImageContainer + .primaryDetailsContainer { - width: 60%; - } -} - @media all and (min-width: 500px) { .mobileDetails { @@ -533,6 +453,19 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { margin-left: 1em; } +.mainDetailButtons { + padding: 1em 0; + display: flex; + align-items: center; +} + + .mainDetailButtons button, .recordingFields button { + background: rgba(170,170, 170, 1); + color: #222; + margin-left: 0; + margin-right: .5em; + } + .detailImageProgressContainer { position: absolute; bottom: 4px; @@ -545,101 +478,58 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { display: inline-block; } -@media all and (min-width: 600px) { - .inlineDetailSection:not(.hide) { - display: inline-block; - margin-bottom: 2em; - } -} +@media all and (max-height: 540px) { -@media all and (max-height: 900px), (max-width: 800px) { - - .itemBackdrop:not(.noBackdrop) { - height: 500px; - } - - .smallBackdrop:not(.noBackdrop) { - height: 300px; - } -} - -@media all and (max-height: 800px), (max-width: 700px) { - - .itemBackdrop:not(.noBackdrop) { - height: 450px; - } - - .smallBackdrop:not(.noBackdrop) { - height: 300px; - } -} - -@media all and (max-height: 700px) { - - .itemBackdrop:not(.noBackdrop) { - height: 350px; - } - - .smallBackdrop:not(.noBackdrop) { - height: 300px; - } -} - -@media all and (max-width: 540px) { - - .itemBackdrop:not(.noBackdrop) { + .itemBackdrop { height: 290px; } - .smallBackdrop:not(.noBackdrop) { - height: 200px; + .detailImageContainer { + top: 200px; } } -@media all and (max-height: 540px) { +@media all and (max-height: 500px) { - .itemBackdrop:not(.noBackdrop) { - height: 250px; + .itemBackdrop { + height: 240px; } - .smallBackdrop:not(.noBackdrop) { - height: 200px; + .detailImageContainer { + top: 150px; } } @media all and (max-height: 460px) { - .itemBackdrop:not(.noBackdrop) { + .itemBackdrop { height: 200px; } - .smallBackdrop:not(.noBackdrop) { - height: 120px; + .detailImageContainer { + top: 110px; } } @media all and (max-height: 300px) { - .itemBackdrop:not(.noBackdrop) { + .itemBackdrop { height: 150px; } - .smallBackdrop:not(.noBackdrop) { - height: 120px; + .detailImageContainer { + top: 60px; } } @media all and (max-height: 250px) { - .itemBackdrop:not(.noBackdrop) { + .itemBackdrop { height: 120px; } -} - -@media all and (max-width: 1000px) { .detailImageContainer { - padding-left: 15px; + top: 30px; } } @@ -652,42 +542,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { .noBackdrop { height: 80px; } - - .detailImageContainer { - margin-top: -55px; - } - - .squareDetailImageContainer { - margin-top: -40px; - } - - .thumbDetailImageContainer { - margin-top: -80px; - } - - .portraitDetailImageContainer + .primaryDetailsContainer { - width: 70%; - } - - .detailImageContainer img { - width: 140px; - /* This is just to make sure it always takes up some space */ - min-height: 140px; - } - - .primaryDetailPageContent p { - margin: 1em 0 !important; - } - - .backdropDetailPageContent { - text-align: center; - } - - .thumbDetailImageContainer img { - width: 180px; - /* This is just to make sure it always takes up some space */ - min-height: 60px; - } } .itemMiscInfo { @@ -698,27 +552,8 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { align-items: center; } -@media all and (max-width: 600px) { - - .portraitDetailImageContainer + .primaryDetailsContainer { - width: 65%; - } -} - @media all and (max-width: 500px) { - .detailImageContainer img { - width: 80px; - /* This is just to make sure it always takes up some space */ - min-height: 60px; - } - - .thumbDetailImageContainer img { - width: 180px; - /* This is just to make sure it always takes up some space */ - min-height: 60px; - } - .mobileDetails .itemMiscInfo { text-align: center; justify-content: center; @@ -729,14 +564,24 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { } } +.detailPageContent { + max-width: 94%; +} + @media all and (min-width: 750px) { .detailPageContent { - max-width: 950px; + max-width: 94%; + } +} + +@media all and (min-width: 1200px) { + .detailPageContent { + max-width: 90%; } } .detailPageParentLink { - text-decoration: none; + font-weight: inherit !important; } .mediaInfoContent { @@ -924,13 +769,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { } } -@media all and (max-width: 1000px) { - - .smallDetailImageContainer { - padding-left: 1em; - } -} - #criticReviewsContent.hiddenScrollX { white-space: nowrap; } @@ -944,26 +782,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { margin: 0 4px 0 0; } - -@media all and (min-width: 1000px) { - - .itemDetailPage .portraitCard-scalable { - width: 20% !important; - } - - .itemDetailPage .squareCard-scalable { - width: 25% !important; - } - - .itemDetailPage .backdropCard-scalable, .itemDetailPage .smallBackdropCard-scalable { - width: 33.3333333333333333% !important; - } - - .itemDetailPage .personCard.portraitCard { - width: 16.666666666666666666666666666667% !important; - } -} - .btnSyncComplete { background: #673AB7 !important; } diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index e05bc57737..80f68c4c37 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -82,10 +82,6 @@ body { overflow-y: hidden !important; } -.textlink { - text-decoration: none; -} - h1, h2, h3 { margin-top: 1em; } diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index 7e565797c6..e71a994dbe 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -3,82 +3,77 @@
- - +
-
+
- - -
-
-
-
-
-

-
- -
+
+
-
- -

-

-
- - - - -
-
-
-
-
-
-
-
-
-
-
- - - - -
-
-
- -
-
-
-
-
+
-
-
-
-

-

+
+

+

+ +
+ +
+ +
+ +
+
+ +
+ + + +
+
+ +
+ +
+ +
+ + +

+

+

+

+

+

+

+

+ +

+

+
-
-

-

-

-

-

-

+
+

@@ -168,7 +163,6 @@ ${HeaderScenes}

-

@@ -176,20 +170,6 @@

-
-

- ${HeaderDetails} -

-
-
-

-

- -

-

-
-
-

@@ -210,4 +190,6 @@

+
+
\ No newline at end of file diff --git a/dashboard-ui/mypreferencesdisplay.html b/dashboard-ui/mypreferencesdisplay.html index d1601ebac6..debf19a594 100644 --- a/dashboard-ui/mypreferencesdisplay.html +++ b/dashboard-ui/mypreferencesdisplay.html @@ -57,9 +57,8 @@
${LabelEnableBackdropsHelp}
diff --git a/dashboard-ui/scripts/autobackdrops.js b/dashboard-ui/scripts/autobackdrops.js index 2ff2363d15..bd43edd650 100644 --- a/dashboard-ui/scripts/autobackdrops.js +++ b/dashboard-ui/scripts/autobackdrops.js @@ -1,16 +1,6 @@ define(['backdrop', 'appStorage'], function (backdrop, appStorage) { 'use strict'; - function isEnabledByDefault() { - - if (AppInfo.hasLowImageBandwidth) { - - return false; - } - - return false; - } - function enabled() { var apiClient = window.ApiClient; @@ -24,7 +14,7 @@ var val = appStorage.getItem('enableBackdrops-' + userId); // For bandwidth - return val == '1' || (val != '0' && isEnabledByDefault()); + return val == '1'; } var cache = {}; diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 1bd77bb7a6..8779907e6b 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1,4 +1,4 @@ -define(['layoutManager', 'cardBuilder', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'userdataButtons', 'dom', 'indicators', 'apphost', 'imageLoader', 'libraryMenu', 'scrollStyles', 'emby-itemscontainer', 'emby-checkbox'], function (layoutManager, cardBuilder, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper, userdataButtons, dom, indicators, appHost, imageLoader, libraryMenu) { +define(['layoutManager', 'cardBuilder', 'datetime', 'mediaInfo', 'backdrop', 'listView', 'itemContextMenu', 'itemHelper', 'userdataButtons', 'dom', 'indicators', 'apphost', 'imageLoader', 'libraryMenu', 'shell', 'globalize', 'scrollStyles', 'emby-itemscontainer', 'emby-checkbox'], function (layoutManager, cardBuilder, datetime, mediaInfo, backdrop, listView, itemContextMenu, itemHelper, userdataButtons, dom, indicators, appHost, imageLoader, libraryMenu, shell, globalize) { 'use strict'; var currentItem; @@ -72,15 +72,14 @@ queue: false, playAllFromHere: false, queueAllFromHere: false, - positionTo: button + positionTo: button, + cancelTimer: false, + record: false }; if (appHost.supports('sync')) { // Will be displayed via button options.syncLocal = false; - } else { - // Will be displayed via button - options.sync = false; } return options; @@ -115,23 +114,14 @@ setInitialCollapsibleState(page, item, context, user); renderDetails(page, item, context); - var hasBackdrop = false; + var itemBackdropElement = page.querySelector('#itemBackdrop'); + itemBackdropElement.classList.add('noBackdrop'); + itemBackdropElement.style.backgroundImage = 'none'; + backdrop.setBackdrops([item]); - // For these types, make the backdrop a little smaller so that the items are more quickly accessible - if (item.Type == 'MusicArtist' || item.Type == "MusicAlbum" || item.Type == "Playlist" || item.Type == "BoxSet" || item.MediaType == "Audio" || !layoutManager.mobile) { - var itemBackdropElement = page.querySelector('#itemBackdrop'); - itemBackdropElement.classList.add('noBackdrop'); - itemBackdropElement.style.backgroundImage = 'none'; - backdrop.setBackdrops([item]); - } - else { - hasBackdrop = LibraryBrowser.renderDetailPageBackdrop(page, item, imageLoader); - backdrop.clear(); - } + LibraryBrowser.renderDetailPageBackdrop(page, item, imageLoader); - var transparentHeader = hasBackdrop && page.classList.contains('noSecondaryNavPage'); - - libraryMenu.setTransparentMenu(transparentHeader); + libraryMenu.setTransparentMenu(true); var canPlay = false; @@ -154,7 +144,7 @@ hideAll(page, 'btnPlay'); } - if (item.LocalTrailerCount && item.PlayAccess == 'Full') { + if ((item.LocalTrailerCount || (item.RemoteTrailers && item.RemoteTrailers.length)) && item.PlayAccess == 'Full') { hideAll(page, 'btnPlayTrailer', true); } else { hideAll(page, 'btnPlayTrailer'); @@ -176,20 +166,6 @@ showRecordingFields(page, item, user); - var btnPlayExternalTrailer = page.querySelectorAll('.btnPlayExternalTrailer'); - for (var i = 0, length = btnPlayExternalTrailer.length; i < length; i++) { - if (!item.LocalTrailerCount && item.RemoteTrailers.length && item.PlayAccess == 'Full') { - - btnPlayExternalTrailer[i].classList.remove('hide'); - btnPlayExternalTrailer[i].href = item.RemoteTrailers[0].Url; - - } else { - - btnPlayExternalTrailer[i].classList.add('hide'); - btnPlayExternalTrailer[i].href = '#'; - } - } - var groupedVersions = (item.MediaSources || []).filter(function (g) { return g.Type == "Grouping"; }); @@ -215,7 +191,7 @@ var birthday = datetime.parseISO8601Date(item.PremiereDate, true).toDateString(); itemBirthday.classList.remove('hide'); - itemBirthday.innerHTML = Globalize.translate('BirthDateValue').replace('{0}', birthday); + itemBirthday.innerHTML = globalize.translate('BirthDateValue').replace('{0}', birthday); } catch (err) { itemBirthday.classList.add('hide'); @@ -231,7 +207,7 @@ var deathday = datetime.parseISO8601Date(item.EndDate, true).toDateString(); itemDeathDate.classList.remove('hide'); - itemDeathDate.innerHTML = Globalize.translate('DeathDateValue').replace('{0}', deathday); + itemDeathDate.innerHTML = globalize.translate('DeathDateValue').replace('{0}', deathday); } catch (err) { itemDeathDate.classList.add('hide'); @@ -245,7 +221,7 @@ var gmap = '' + item.ProductionLocations[0] + ''; itemBirthLocation.classList.remove('hide'); - itemBirthLocation.innerHTML = Globalize.translate('BirthPlaceValue').replace('{0}', gmap); + itemBirthLocation.innerHTML = globalize.translate('BirthPlaceValue').replace('{0}', gmap); } else { itemBirthLocation.classList.add('hide'); } @@ -322,7 +298,7 @@ var links = []; if (item.HomePageUrl) { - links.push('' + Globalize.translate('ButtonWebsite') + ''); + links.push('' + globalize.translate('ButtonWebsite') + ''); } if (item.ExternalUrls) { @@ -337,9 +313,7 @@ if (links.length) { - var html = links.join('  /  '); - - html = Globalize.translate('ValueLinks', html); + var html = links.join('•'); linksElem.innerHTML = html; linksElem.classList.remove('hide'); @@ -349,9 +323,34 @@ } } + function shadeBlendConvert(p, from, to) { + if (typeof (p) != "number" || p < -1 || p > 1 || typeof (from) != "string" || (from[0] != 'r' && from[0] != '#') || (typeof (to) != "string" && typeof (to) != "undefined")) return null; //ErrorCheck + + var sbcRip = function (d) { + var l = d.length, RGB = new Object(); + if (l > 9) { + d = d.split(","); + if (d.length < 3 || d.length > 4) return null; //ErrorCheck + RGB[0] = i(d[0].slice(4)), RGB[1] = i(d[1]), RGB[2] = i(d[2]), RGB[3] = d[3] ? parseFloat(d[3]) : -1; + } else { + if (l == 8 || l == 6 || l < 4) return null; //ErrorCheck + if (l < 6) d = "#" + d[1] + d[1] + d[2] + d[2] + d[3] + d[3] + (l > 4 ? d[4] + "" + d[4] : ""); //3 digit + d = i(d.slice(1), 16), RGB[0] = d >> 16 & 255, RGB[1] = d >> 8 & 255, RGB[2] = d & 255, RGB[3] = l == 9 || l == 5 ? r(((d >> 24 & 255) / 255) * 10000) / 10000 : -1; + } + return RGB; + }; + + var i = parseInt, r = Math.round, h = from.length > 9, h = typeof (to) == "string" ? to.length > 9 ? true : to == "c" ? !h : false : h, b = p < 0, p = b ? p * -1 : p, to = to && to != "c" ? to : b ? "#000000" : "#FFFFFF", f = sbcRip(from), t = sbcRip(to); + if (!f || !t) return null; //ErrorCheck + if (h) return "rgb(" + r((t[0] - f[0]) * p + f[0]) + "," + r((t[1] - f[1]) * p + f[1]) + "," + r((t[2] - f[2]) * p + f[2]) + (f[3] < 0 && t[3] < 0 ? ")" : "," + (f[3] > -1 && t[3] > -1 ? r(((t[3] - f[3]) * p + f[3]) * 10000) / 10000 : t[3] < 0 ? f[3] : t[3]) + ")"); + else return "#" + (0x100000000 + (f[3] > -1 && t[3] > -1 ? r(((t[3] - f[3]) * p + f[3]) * 255) : t[3] > -1 ? r(t[3] * 255) : f[3] > -1 ? r(f[3] * 255) : 255) * 0x1000000 + r((t[0] - f[0]) * p + f[0]) * 0x10000 + r((t[1] - f[1]) * p + f[1]) * 0x100 + r((t[2] - f[2]) * p + f[2])).toString(16).slice(f[3] > -1 || t[3] > -1 ? 1 : 3); + } + function renderImage(page, item, user) { - LibraryBrowser.renderDetailImage(page.querySelector('.detailImageContainer'), item, user.Policy.IsAdministrator && item.MediaType != 'Photo', null, imageLoader, indicators); + var container = page.querySelector('.detailImageContainer'); + + LibraryBrowser.renderDetailImage(container, item, user.Policy.IsAdministrator && item.MediaType != 'Photo', null, imageLoader, indicators); } function refreshDetailImageUserData(elem, item) { @@ -369,9 +368,9 @@ function setPeopleHeader(page, item) { if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.MediaType == "Book" || item.MediaType == "Photo") { - page.querySelector('#peopleHeader').innerHTML = Globalize.translate('HeaderPeople'); + page.querySelector('#peopleHeader').innerHTML = globalize.translate('HeaderPeople'); } else { - page.querySelector('#peopleHeader').innerHTML = Globalize.translate('HeaderCastAndCrew'); + page.querySelector('#peopleHeader').innerHTML = globalize.translate('HeaderCastAndCrew'); } } @@ -519,7 +518,7 @@ if (overview) { elem.innerHTML = overview; - elem.classList.remove('empty'); + elem.classList.remove('hide'); var anchors = elem.querySelectorAll('a'); for (var j = 0, length2 = anchors.length; j < length2; j++) { @@ -529,7 +528,7 @@ } else { elem.innerHTML = ''; - elem.classList.add('empty'); + elem.classList.add('hide'); } } } @@ -539,10 +538,6 @@ renderSimilarItems(page, item, context); renderMoreFromItems(page, item); - if (!isStatic) { - renderSiblingLinks(page, item, context); - } - var taglineElement = page.querySelector('.tagline'); if (item.Taglines && item.Taglines.length) { @@ -552,30 +547,35 @@ taglineElement.classList.add('hide'); } - var topOverview = page.querySelector('.topOverview'); - var bottomOverview = page.querySelector('.bottomOverview'); + var overview = page.querySelector('.overview'); - var seasonOnBottom = screen.availHeight < 800 || screen.availWidth < 600; - - if (item.Type == 'MusicAlbum' || item.Type == 'MusicArtist' || (item.Type == 'Season' && seasonOnBottom)) { - renderOverview([bottomOverview], item); - topOverview.classList.add('hide'); - bottomOverview.classList.remove('hide'); - } else { - renderOverview([topOverview], item); - topOverview.classList.remove('hide'); - bottomOverview.classList.add('hide'); - } + renderOverview([overview], item); renderAwardSummary(page.querySelector('#awardSummary'), item); var i, length; - var itemMiscInfo = page.querySelectorAll('.itemMiscInfo'); + var itemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary'); for (i = 0, length = itemMiscInfo.length; i < length; i++) { mediaInfo.fillPrimaryMediaInfo(itemMiscInfo[i], item, { interactive: true, episodeTitle: false }); + if (itemMiscInfo[i].innerHTML) { + itemMiscInfo[i].classList.remove('hide'); + } else { + itemMiscInfo[i].classList.add('hide'); + } + } + itemMiscInfo = page.querySelectorAll('.itemMiscInfo-secondary'); + for (i = 0, length = itemMiscInfo.length; i < length; i++) { + mediaInfo.fillSecondaryMediaInfo(itemMiscInfo[i], item, { + interactive: true + }); + if (itemMiscInfo[i].innerHTML) { + itemMiscInfo[i].classList.remove('hide'); + } else { + itemMiscInfo[i].classList.add('hide'); + } } var itemGenres = page.querySelectorAll('.itemGenres'); for (i = 0, length = itemGenres.length; i < length; i++) { @@ -600,13 +600,13 @@ renderSeriesAirTime(page, item, isStatic); - var playersElement = page.querySelector('#players'); + var dateAddedElement = page.querySelector('#dateAdded'); - if (item.Players) { - playersElement.classList.remove('hide'); - playersElement.innerHTML = item.Players + ' Player'; + if (!item.IsFolder) { + dateAddedElement.classList.remove('hide'); + dateAddedElement.innerHTML = globalize.translate('DateAddedValue', datetime.toLocaleDateString(datetime.parseISO8601Date(item.DateCreated))); } else { - playersElement.classList.add('hide'); + dateAddedElement.classList.add('hide'); } var artist = page.querySelectorAll('.artist'); @@ -631,8 +631,6 @@ } else { page.querySelector('.photoInfo').classList.add('hide'); } - - renderTabButtons(page, item); } function renderPhotoInfo(page, item) { @@ -642,30 +640,30 @@ var attributes = []; if (item.CameraMake) { - attributes.push(createAttribute(Globalize.translate('MediaInfoCameraMake'), item.CameraMake)); + attributes.push(createAttribute(globalize.translate('MediaInfoCameraMake'), item.CameraMake)); } if (item.CameraModel) { - attributes.push(createAttribute(Globalize.translate('MediaInfoCameraModel'), item.CameraModel)); + attributes.push(createAttribute(globalize.translate('MediaInfoCameraModel'), item.CameraModel)); } if (item.Altitude) { - attributes.push(createAttribute(Globalize.translate('MediaInfoAltitude'), item.Altitude.toFixed(1))); + attributes.push(createAttribute(globalize.translate('MediaInfoAltitude'), item.Altitude.toFixed(1))); } if (item.Aperture) { - attributes.push(createAttribute(Globalize.translate('MediaInfoAperture'), 'F' + item.Aperture.toFixed(1))); + attributes.push(createAttribute(globalize.translate('MediaInfoAperture'), 'F' + item.Aperture.toFixed(1))); } if (item.ExposureTime) { var val = 1 / item.ExposureTime; - attributes.push(createAttribute(Globalize.translate('MediaInfoExposureTime'), '1/' + val + ' s')); + attributes.push(createAttribute(globalize.translate('MediaInfoExposureTime'), '1/' + val + ' s')); } if (item.FocalLength) { - attributes.push(createAttribute(Globalize.translate('MediaInfoFocalLength'), item.FocalLength.toFixed(1) + ' mm')); + attributes.push(createAttribute(globalize.translate('MediaInfoFocalLength'), item.FocalLength.toFixed(1) + ' mm')); } if (item.ImageOrientation) { @@ -673,23 +671,23 @@ } if (item.IsoSpeedRating) { - attributes.push(createAttribute(Globalize.translate('MediaInfoIsoSpeedRating'), item.IsoSpeedRating)); + attributes.push(createAttribute(globalize.translate('MediaInfoIsoSpeedRating'), item.IsoSpeedRating)); } if (item.Latitude) { - attributes.push(createAttribute(Globalize.translate('MediaInfoLatitude'), item.Latitude.toFixed(1))); + attributes.push(createAttribute(globalize.translate('MediaInfoLatitude'), item.Latitude.toFixed(1))); } if (item.Longitude) { - attributes.push(createAttribute(Globalize.translate('MediaInfoLongitude'), item.Longitude.toFixed(1))); + attributes.push(createAttribute(globalize.translate('MediaInfoLongitude'), item.Longitude.toFixed(1))); } if (item.ShutterSpeed) { - attributes.push(createAttribute(Globalize.translate('MediaInfoShutterSpeed'), item.ShutterSpeed)); + attributes.push(createAttribute(globalize.translate('MediaInfoShutterSpeed'), item.ShutterSpeed)); } if (item.Software) { - attributes.push(createAttribute(Globalize.translate('MediaInfoSoftware'), item.Software)); + attributes.push(createAttribute(globalize.translate('MediaInfoSoftware'), item.Software)); } html += attributes.join('
'); @@ -697,20 +695,6 @@ page.querySelector('.photoInfoContent').innerHTML = html; } - function renderTabButtons(page, item) { - - var elem = page.querySelector('.tabDetails'); - var text = elem.textContent || elem.innerText || ''; - - if (text.trim()) { - - page.querySelector('.detailsSection').classList.remove('hide'); - - } else { - page.querySelector('.detailsSection').classList.add('hide'); - } - } - function getArtistLinksHtml(artists, context) { var html = []; @@ -726,82 +710,15 @@ html = html.join(' / '); if (artists.length == 1) { - return Globalize.translate('ValueArtist', html); + return globalize.translate('ValueArtist', html); } if (artists.length > 1) { - return Globalize.translate('ValueArtists', html); + return globalize.translate('ValueArtists', html); } return html; } - function renderSiblingLinks(page, item, context) { - - var lnkPreviousItem = page.querySelector('.lnkPreviousItem'); - var lnkNextItem = page.querySelector('.lnkNextItem'); - - if ((item.Type != "Episode" && item.Type != "Season" && item.Type != "Audio" && item.Type != "Photo")) { - lnkNextItem.classList.add('hide'); - lnkPreviousItem.classList.add('hide'); - - return; - } - - var promise; - - if (item.Type == "Season") { - - promise = ApiClient.getSeasons(item.SeriesId, { - - userId: Dashboard.getCurrentUserId(), - AdjacentTo: item.Id - }); - } - else if (item.Type == "Episode" && item.SeasonId) { - - // Use dedicated episodes endpoint - promise = ApiClient.getEpisodes(item.SeriesId, { - - seasonId: item.SeasonId, - userId: Dashboard.getCurrentUserId(), - AdjacentTo: item.Id - }); - - } else { - promise = ApiClient.getItems(Dashboard.getCurrentUserId(), { - AdjacentTo: item.Id, - ParentId: item.ParentId, - SortBy: 'SortName' - }); - } - - context = context || ''; - - promise.then(function (result) { - - var foundExisting = false; - - for (var i = 0, length = result.Items.length; i < length; i++) { - - var curr = result.Items[i]; - - if (curr.Id == item.Id) { - foundExisting = true; - } - else if (!foundExisting) { - - lnkPreviousItem.classList.remove('hide'); - lnkPreviousItem.href = 'itemdetails.html?id=' + curr.Id + '&context=' + context; - } - else { - - lnkNextItem.classList.remove('hide'); - lnkNextItem.href = 'itemdetails.html?id=' + curr.Id + '&context=' + context; - } - } - }); - } - function enableScrollX() { return browserInfo.mobile && AppInfo.enableAppLayouts && screen.availWidth <= 1000; } @@ -856,7 +773,7 @@ } moreFromSection.classList.remove('hide'); - moreFromSection.querySelector('.moreFromHeader').innerHTML = Globalize.translate('MoreFromValue', item.AlbumArtists[0].Name); + moreFromSection.querySelector('.moreFromHeader').innerHTML = globalize.translate('MoreFromValue', item.AlbumArtists[0].Name); var html = ''; @@ -1016,7 +933,7 @@ if (item.Tags && item.Tags.length) { var html = ''; - html += '

' + Globalize.translate('HeaderTags') + '

'; + html += '

' + globalize.translate('HeaderTags') + '

'; for (var i = 0, length = item.Tags.length; i < length; i++) { html += '
' + item.Tags[i] + '
'; @@ -1199,11 +1116,11 @@ if (item.Type == "BoxSet") { var collectionItemTypes = [ - { name: Globalize.translate('HeaderMovies'), type: 'Movie' }, - { name: Globalize.translate('HeaderSeries'), type: 'Series' }, - { name: Globalize.translate('HeaderAlbums'), type: 'MusicAlbum' }, - { name: Globalize.translate('HeaderGames'), type: 'Game' }, - { name: Globalize.translate('HeaderBooks'), type: 'Book' } + { name: globalize.translate('HeaderMovies'), type: 'Movie' }, + { name: globalize.translate('HeaderSeries'), type: 'Series' }, + { name: globalize.translate('HeaderAlbums'), type: 'MusicAlbum' }, + { name: globalize.translate('HeaderGames'), type: 'Game' }, + { name: globalize.translate('HeaderBooks'), type: 'Book' } ]; renderCollectionItems(page, item, collectionItemTypes, result.Items); @@ -1211,19 +1128,19 @@ }); if (item.Type == "Season") { - page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderEpisodes'); + page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderEpisodes'); } else if (item.Type == "Series") { - page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderSeasons'); + page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderSeasons'); } else if (item.Type == "MusicAlbum") { - page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderTracks'); + page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderTracks'); } else if (item.Type == "GameSystem") { - page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderGames'); + page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderGames'); } else { - page.querySelector('#childrenTitle').innerHTML = Globalize.translate('HeaderItems'); + page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderItems'); } if (item.Type == "MusicAlbum") { @@ -1324,7 +1241,7 @@ var context = inferContext(item); - if (item.Studios && item.Studios.length && item.Type != "Series") { + if (item.Studios && item.Studios.length && item.Type != "Series" && false) { var html = ''; @@ -1346,7 +1263,7 @@ var translationKey = item.Studios.length > 1 ? "ValueStudios" : "ValueStudio"; - html = Globalize.translate(translationKey, html); + html = globalize.translate(translationKey, html); elem.innerHTML = html; elem.classList.remove('hide'); @@ -1371,7 +1288,7 @@ } if (i > 0) { - html += '  /  '; + html += '•'; } var param = item.Type == "Audio" || item.Type == "MusicArtist" || item.Type == "MusicAlbum" ? "musicgenre" : "genre"; @@ -1409,7 +1326,7 @@ function renderAwardSummary(elem, item) { if (item.AwardSummary) { elem.classList.remove('hide'); - elem.innerHTML = Globalize.translate('ValueAwards', item.AwardSummary); + elem.innerHTML = globalize.translate('ValueAwards', item.AwardSummary); } else { elem.classList.add('hide'); } @@ -1436,7 +1353,7 @@ } } - var otherType = { name: Globalize.translate('HeaderOtherItems') }; + var otherType = { name: globalize.translate('HeaderOtherItems') }; var otherTypeItems = items.filter(function (curr) { @@ -1453,7 +1370,7 @@ } if (!items.length) { - renderCollectionItemType(page, parentItem, { name: Globalize.translate('HeaderItems') }, items); + renderCollectionItemType(page, parentItem, { name: globalize.translate('HeaderItems') }, items); } } @@ -1498,8 +1415,8 @@ collectionItems.querySelector('.btnAddToCollection').addEventListener('click', function () { require(['alert'], function (alert) { alert({ - text: Globalize.translate('AddItemToCollectionHelp'), - html: Globalize.translate('AddItemToCollectionHelp') + '

' + Globalize.translate('ButtonLearnMore') + '' + text: globalize.translate('AddItemToCollectionHelp'), + html: globalize.translate('AddItemToCollectionHelp') + '

' + globalize.translate('ButtonLearnMore') + '' }); }); }); @@ -1597,7 +1514,7 @@ html += '
'; if (review.Url) { - html += ''; + html += ''; } html += '
'; @@ -1607,7 +1524,7 @@ } if (limit && result.TotalRecordCount > limit) { - html += '

'; + html += '

'; } var criticReviewsContent = page.querySelector('#criticReviewsContent'); @@ -1712,25 +1629,17 @@ }); } - function renderScenes(page, item, user, limit, isStatic) { + function renderScenes(page, item, user) { var chapters = item.Chapters || []; var scenesContent = page.querySelector('#scenesContent'); if (enableScrollX()) { scenesContent.classList.add('smoothScrollX'); - limit = null; } else { scenesContent.classList.add('vertical-wrap'); } - var limitExceeded = limit && chapters.length > limit; - - if (limitExceeded) { - chapters = chapters.slice(0); - chapters.length = Math.min(limit, chapters.length); - } - require(['chaptercardbuilder'], function (chaptercardbuilder) { chaptercardbuilder.buildChapterCards(item, chapters, { @@ -1741,15 +1650,6 @@ squareShape: getSquareShape() }); }); - - var moreScenesButton = page.querySelector('.moreScenes'); - if (moreScenesButton) { - if (limitExceeded) { - moreScenesButton.classList.remove('hide'); - } else { - moreScenesButton.classList.add('hide'); - } - } } function renderMediaSources(page, user, item) { @@ -1786,22 +1686,22 @@ html += '
'; - var displayType = Globalize.translate('MediaInfoStreamType' + stream.Type); + var displayType = globalize.translate('MediaInfoStreamType' + stream.Type); html += '

' + displayType + '

'; var attributes = []; if (stream.Language && stream.Type != "Video") { - attributes.push(createAttribute(Globalize.translate('MediaInfoLanguage'), stream.Language)); + attributes.push(createAttribute(globalize.translate('MediaInfoLanguage'), stream.Language)); } if (stream.Codec) { - attributes.push(createAttribute(Globalize.translate('MediaInfoCodec'), stream.Codec.toUpperCase())); + attributes.push(createAttribute(globalize.translate('MediaInfoCodec'), stream.Codec.toUpperCase())); } if (stream.CodecTag) { - attributes.push(createAttribute(Globalize.translate('MediaInfoCodecTag'), stream.CodecTag)); + attributes.push(createAttribute(globalize.translate('MediaInfoCodecTag'), stream.CodecTag)); } if (stream.IsAVC != null) { @@ -1809,58 +1709,58 @@ } if (stream.Profile) { - attributes.push(createAttribute(Globalize.translate('MediaInfoProfile'), stream.Profile)); + attributes.push(createAttribute(globalize.translate('MediaInfoProfile'), stream.Profile)); } if (stream.Level) { - attributes.push(createAttribute(Globalize.translate('MediaInfoLevel'), stream.Level)); + attributes.push(createAttribute(globalize.translate('MediaInfoLevel'), stream.Level)); } if (stream.Width || stream.Height) { - attributes.push(createAttribute(Globalize.translate('MediaInfoResolution'), stream.Width + 'x' + stream.Height)); + attributes.push(createAttribute(globalize.translate('MediaInfoResolution'), stream.Width + 'x' + stream.Height)); } if (stream.AspectRatio && stream.Codec != "mjpeg") { - attributes.push(createAttribute(Globalize.translate('MediaInfoAspectRatio'), stream.AspectRatio)); + attributes.push(createAttribute(globalize.translate('MediaInfoAspectRatio'), stream.AspectRatio)); } if (stream.Type == "Video") { if (stream.IsAnamorphic != null) { - attributes.push(createAttribute(Globalize.translate('MediaInfoAnamorphic'), (stream.IsAnamorphic ? 'Yes' : 'No'))); + attributes.push(createAttribute(globalize.translate('MediaInfoAnamorphic'), (stream.IsAnamorphic ? 'Yes' : 'No'))); } - attributes.push(createAttribute(Globalize.translate('MediaInfoInterlaced'), (stream.IsInterlaced ? 'Yes' : 'No'))); + attributes.push(createAttribute(globalize.translate('MediaInfoInterlaced'), (stream.IsInterlaced ? 'Yes' : 'No'))); } if (stream.AverageFrameRate || stream.RealFrameRate) { - attributes.push(createAttribute(Globalize.translate('MediaInfoFramerate'), (stream.AverageFrameRate || stream.RealFrameRate))); + attributes.push(createAttribute(globalize.translate('MediaInfoFramerate'), (stream.AverageFrameRate || stream.RealFrameRate))); } if (stream.ChannelLayout) { - attributes.push(createAttribute(Globalize.translate('MediaInfoLayout'), stream.ChannelLayout)); + attributes.push(createAttribute(globalize.translate('MediaInfoLayout'), stream.ChannelLayout)); } if (stream.Channels) { - attributes.push(createAttribute(Globalize.translate('MediaInfoChannels'), stream.Channels + ' ch')); + attributes.push(createAttribute(globalize.translate('MediaInfoChannels'), stream.Channels + ' ch')); } if (stream.BitRate && stream.Codec != "mjpeg") { - attributes.push(createAttribute(Globalize.translate('MediaInfoBitrate'), (parseInt(stream.BitRate / 1000)) + ' kbps')); + attributes.push(createAttribute(globalize.translate('MediaInfoBitrate'), (parseInt(stream.BitRate / 1000)) + ' kbps')); } if (stream.SampleRate) { - attributes.push(createAttribute(Globalize.translate('MediaInfoSampleRate'), stream.SampleRate + ' Hz')); + attributes.push(createAttribute(globalize.translate('MediaInfoSampleRate'), stream.SampleRate + ' Hz')); } if (stream.BitDepth) { - attributes.push(createAttribute(Globalize.translate('MediaInfoBitDepth'), stream.BitDepth + ' bit')); + attributes.push(createAttribute(globalize.translate('MediaInfoBitDepth'), stream.BitDepth + ' bit')); } if (stream.PixelFormat) { - attributes.push(createAttribute(Globalize.translate('MediaInfoPixelFormat'), stream.PixelFormat)); + attributes.push(createAttribute(globalize.translate('MediaInfoPixelFormat'), stream.PixelFormat)); } if (stream.RefFrames) { - attributes.push(createAttribute(Globalize.translate('MediaInfoRefFrames'), stream.RefFrames)); + attributes.push(createAttribute(globalize.translate('MediaInfoRefFrames'), stream.RefFrames)); } if (stream.NalLengthSize) { @@ -1868,15 +1768,15 @@ } if (stream.Type != "Video") { - attributes.push(createAttribute(Globalize.translate('MediaInfoDefault'), (stream.IsDefault ? 'Yes' : 'No'))); + attributes.push(createAttribute(globalize.translate('MediaInfoDefault'), (stream.IsDefault ? 'Yes' : 'No'))); } if (stream.Type == "Subtitle") { - attributes.push(createAttribute(Globalize.translate('MediaInfoForced'), (stream.IsForced ? 'Yes' : 'No'))); - attributes.push(createAttribute(Globalize.translate('MediaInfoExternal'), (stream.IsExternal ? 'Yes' : 'No'))); + attributes.push(createAttribute(globalize.translate('MediaInfoForced'), (stream.IsForced ? 'Yes' : 'No'))); + attributes.push(createAttribute(globalize.translate('MediaInfoExternal'), (stream.IsExternal ? 'Yes' : 'No'))); } if (stream.Type == "Video" && version.Timestamp) { - attributes.push(createAttribute(Globalize.translate('MediaInfoTimestamp'), version.Timestamp)); + attributes.push(createAttribute(globalize.translate('MediaInfoTimestamp'), version.Timestamp)); } if (stream.DisplayTitle) { @@ -1889,7 +1789,7 @@ } if (version.Container) { - html += '
' + Globalize.translate('MediaInfoContainer') + '' + version.Container + '
'; + html += '
' + globalize.translate('MediaInfoContainer') + '' + version.Container + '
'; } if (version.Formats && version.Formats.length) { @@ -1897,14 +1797,14 @@ } if (version.Path && version.Protocol != 'Http' && user && user.Policy.IsAdministrator) { - html += '
' + Globalize.translate('MediaInfoPath') + '' + version.Path + '
'; + html += '
' + globalize.translate('MediaInfoPath') + '' + version.Path + '
'; } if (version.Size) { var size = (version.Size / (1024 * 1024)).toFixed(0); - html += '
' + Globalize.translate('MediaInfoSize') + '' + size + ' MB
'; + html += '
' + globalize.translate('MediaInfoSize') + '' + size + ' MB
'; } return html; @@ -1926,7 +1826,7 @@ }); if (limit && items.length > limit) { - html += '

'; + html += '

'; } return html; @@ -2015,6 +1915,12 @@ function playTrailer(page) { + if (!currentItem.LocalTrailerCount) { + + shell.openUrl(currentItem.RemoteTrailers[0].Url); + return; + } + ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), currentItem.Id).then(function (trailers) { MediaController.play({ items: trailers }); @@ -2053,14 +1959,14 @@ require(['confirm'], function (confirm) { - confirm(Globalize.translate('MessageConfirmRecordingCancellation'), Globalize.translate('HeaderConfirmRecordingCancellation')).then(function () { + confirm(globalize.translate('MessageConfirmRecordingCancellation'), globalize.translate('HeaderConfirmRecordingCancellation')).then(function () { Dashboard.showLoadingMsg(); ApiClient.cancelLiveTvTimer(id).then(function () { require(['toast'], function (toast) { - toast(Globalize.translate('MessageRecordingCancelled')); + toast(globalize.translate('MessageRecordingCancelled')); }); reload(page, params); @@ -2088,15 +1994,6 @@ playCurrentItem(this); } - function onSyncClick() { - require(['syncDialog'], function (syncDialog) { - syncDialog.showMenu({ - items: [currentItem], - serverId: ApiClient.serverId() - }); - }); - } - return function (view, params) { function resetSyncStatus() { @@ -2120,7 +2017,7 @@ require(['confirm'], function (confirm) { - confirm(Globalize.translate('ConfirmRemoveDownload')).then(function () { + confirm(globalize.translate('ConfirmRemoveDownload')).then(function () { ApiClient.cancelSyncItems([currentItem.Id]); }, resetSyncStatus); }); @@ -2176,11 +2073,6 @@ splitVersions(view, params); }); - elems = view.querySelectorAll('.btnSync'); - for (i = 0, length = elems.length; i < length; i++) { - elems[i].addEventListener('click', onSyncClick); - } - elems = view.querySelectorAll('.chkOffline'); for (i = 0, length = elems.length; i < length; i++) { elems[i].addEventListener('change', onSyncLocalClick); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index ca6aae0af5..5f8eca68f3 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -454,8 +454,6 @@ includeParentInfo: false }); - LibraryMenu.setTitle(name); - if (linkToElement) { nameElem.innerHTML = '' + name + ''; } else { @@ -803,30 +801,6 @@ }); shape = 'square'; } - else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicGenre") { - url = "css/images/items/detail/audio.png"; - shape = 'square'; - } - else if (item.MediaType == "Game" || item.Type == "GameGenre") { - url = "css/images/items/detail/game.png"; - shape = 'square'; - } - else if (item.Type == "Person") { - url = "css/images/items/detail/person.png"; - shape = 'square'; - } - else if (item.Type == "Genre" || item.Type == "Studio") { - url = "css/images/items/detail/video.png"; - shape = 'square'; - } - else if (item.Type == "TvChannel") { - url = "css/images/items/detail/tv.png"; - shape = 'square'; - } - else { - url = "css/images/items/detail/video.png"; - shape = 'square'; - } html += '
'; @@ -876,13 +850,15 @@ elem.classList.remove('squareDetailImageContainer'); } - var img = elem.querySelector('img'); - img.onload = function () { - if (img.src.indexOf('empty.png') == -1) { - img.classList.add('loaded'); - } - }; - imageLoader.lazyImage(img, url); + if (url) { + var img = elem.querySelector('img'); + img.onload = function () { + if (img.src.indexOf('empty.png') == -1) { + img.classList.add('loaded'); + } + }; + imageLoader.lazyImage(img, url); + } }, renderDetailPageBackdrop: function (page, item, imageLoader) { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 3cc93ee2e1..8808f8fe80 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -147,7 +147,7 @@ require(['apphost'], function (apphost) { if (apphost.supports('voiceinput')) { - header.querySelector('.headerVoiceButton').classList.remove('hide'); + header.querySelector('.headerVoiceButton').classList.add('hide'); } else { header.querySelector('.headerVoiceButton').classList.add('hide'); } diff --git a/dashboard-ui/strings/en-US.json b/dashboard-ui/strings/en-US.json index 1b8ae09ce0..6be4fd3014 100644 --- a/dashboard-ui/strings/en-US.json +++ b/dashboard-ui/strings/en-US.json @@ -170,6 +170,7 @@ "OptionPlayCount": "Play Count", "OptionDatePlayed": "Date Played", "OptionDateAdded": "Date Added", + "DateAddedValue": "Date added: {0}", "OptionAlbumArtist": "Album Artist", "OptionArtist": "Artist", "OptionAlbum": "Album",