From 6f73ce4cc3a24fd9ed9d1dc75d0fbd60844abac6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 2 Oct 2016 23:49:52 -0400 Subject: [PATCH] update components --- .../emby-webcomponents/.bower.json | 8 +- .../emby-webcomponents/browser.js | 35 +- .../browserdeviceprofile.js | 17 +- .../emby-webcomponents/cardbuilder/card.css | 2 +- .../cardbuilder/cardbuilder.js | 412 +++++++++++------- .../cardbuilder/chaptercardbuilder.js | 22 +- .../cardbuilder/peoplecardbuilder.js | 20 +- .../emby-webcomponents/guide/guide.js | 2 + .../indicators/indicators.js | 4 +- .../emby-webcomponents/itemcontextmenu.js | 32 +- .../emby-webcomponents/itemhelper.js | 10 +- .../itemhovermenu/itemhovermenu.js | 2 +- .../emby-webcomponents/listview/listview.css | 5 +- .../emby-webcomponents/mediainfo/mediainfo.js | 4 +- .../recordingcreator/recordingcreator.css | 1 + .../emby-webcomponents/shortcuts.js | 3 + 16 files changed, 332 insertions(+), 247 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index 0e8a5bd608..122b18482c 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.280", - "_release": "1.4.280", + "version": "1.4.281", + "_release": "1.4.281", "_resolution": { "type": "version", - "tag": "1.4.280", - "commit": "8bba9abc91102cf3056def424838590f61a0c2ac" + "tag": "1.4.281", + "commit": "6f766fd6733ce492387abd5d6f339983085f2359" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.1", diff --git a/dashboard-ui/bower_components/emby-webcomponents/browser.js b/dashboard-ui/bower_components/emby-webcomponents/browser.js index caad74df9d..9397f448bd 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/browser.js +++ b/dashboard-ui/bower_components/emby-webcomponents/browser.js @@ -1,27 +1,28 @@ define([], function () { + 'use strict'; function isTv() { // This is going to be really difficult to get right var userAgent = navigator.userAgent.toLowerCase(); - if (userAgent.indexOf('tv') != -1) { + if (userAgent.indexOf('tv') !== -1) { return true; } - if (userAgent.indexOf('samsungbrowser') != -1) { + if (userAgent.indexOf('samsungbrowser') !== -1) { return true; } - if (userAgent.indexOf('nintendo') != -1) { + if (userAgent.indexOf('nintendo') !== -1) { return true; } - if (userAgent.indexOf('viera') != -1) { + if (userAgent.indexOf('viera') !== -1) { return true; } - if (userAgent.indexOf('webos') != -1) { + if (userAgent.indexOf('webos') !== -1) { return true; } @@ -45,7 +46,7 @@ var lower = userAgent.toLowerCase(); for (var i = 0, length = terms.length; i < length; i++) { - if (lower.indexOf(terms[i]) != -1) { + if (lower.indexOf(terms[i]) !== -1) { return true; } } @@ -135,20 +136,20 @@ var browser = match[1] || ""; - if (browser == "edge") { + if (browser === "edge") { platform_match = [""]; } else { - if (ua.indexOf("windows phone") != -1 || ua.indexOf("iemobile") != -1) { + if (ua.indexOf("windows phone") !== -1 || ua.indexOf("iemobile") !== -1) { // http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update browser = "msie"; } - else if (ua.indexOf("like gecko") != -1 && ua.indexOf('webkit') == -1 && ua.indexOf('opera') == -1 && ua.indexOf('chrome') == -1 && ua.indexOf('safari') == -1) { + else if (ua.indexOf("like gecko") !== -1 && ua.indexOf('webkit') === -1 && ua.indexOf('opera') === -1 && ua.indexOf('chrome') === -1 && ua.indexOf('safari') === -1) { browser = "msie"; } } - if (browser == 'opr') { + if (browser === 'opr') { browser = 'opera'; } @@ -172,11 +173,11 @@ browser[matched.platform] = true; } - if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") != -1) { + if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") !== -1) { browser.safari = true; } - if (userAgent.toLowerCase().indexOf("playstation 4") != -1) { + if (userAgent.toLowerCase().indexOf("playstation 4") !== -1) { browser.ps4 = true; browser.tv = true; } @@ -185,14 +186,14 @@ browser.mobile = true; } - browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') != -1; + browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') !== -1; browser.animate = document.documentElement.animate != null; - browser.tizen = userAgent.toLowerCase().indexOf('tizen') != -1 || userAgent.toLowerCase().indexOf('smarthub') != -1; - browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) != -1; - browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') != -1; + browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || userAgent.toLowerCase().indexOf('smarthub') !== -1; + browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1; + browser.edgeUwp = browser.edge && userAgent.toLowerCase().indexOf('msapphost') !== -1; browser.tv = isTv(); - browser.operaTv = browser.tv && userAgent.toLowerCase().indexOf('opr/') != -1; + browser.operaTv = browser.tv && userAgent.toLowerCase().indexOf('opr/') !== -1; if (!isStyleSupported('display', 'flex')) { browser.noFlex = true; diff --git a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js index 3dbe273dd2..3d51872eed 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js +++ b/dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js @@ -1,4 +1,5 @@ define(['browser'], function (browser) { + 'use strict'; function canPlayH264() { var v = document.createElement('video'); @@ -58,7 +59,7 @@ define(['browser'], function (browser) { var typeString; - if (format == 'flac') { + if (format === 'flac') { if (browser.tizen) { return true; } @@ -67,7 +68,7 @@ define(['browser'], function (browser) { } } - else if (format == 'wma') { + else if (format === 'wma') { if (browser.tizen) { return true; } @@ -76,7 +77,7 @@ define(['browser'], function (browser) { } } - else if (format == 'opus') { + else if (format === 'opus') { typeString = 'audio/ogg; codecs="opus"'; if (document.createElement('audio').canPlayType(typeString).replace(/no/, '')) { @@ -86,7 +87,7 @@ define(['browser'], function (browser) { return false; } - if (format == 'webma') { + if (format === 'webma') { typeString = 'audio/webm'; } else { typeString = 'audio/' + format; @@ -117,7 +118,7 @@ define(['browser'], function (browser) { } // Filter out browsers based on chromium that don't support mkv - if (userAgent.indexOf('vivaldi') != -1 || userAgent.indexOf('opera') != -1) { + if (userAgent.indexOf('vivaldi') !== -1 || userAgent.indexOf('opera') !== -1) { return false; } @@ -221,7 +222,7 @@ define(['browser'], function (browser) { if (browser.tizen) { // 2015 models - if (userAgent.indexOf('tizen 2.3') != -1) { + if (userAgent.indexOf('tizen 2.3') !== -1) { return 20000000; } @@ -347,12 +348,12 @@ define(['browser'], function (browser) { ['opus', 'mp3', 'aac', 'flac', 'webma', 'wma', 'wav'].filter(canPlayAudioFormat).forEach(function (audioFormat) { profile.DirectPlayProfiles.push({ - Container: audioFormat == 'webma' ? 'webma,webm' : audioFormat, + Container: audioFormat === 'webma' ? 'webma,webm' : audioFormat, Type: 'Audio' }); // aac also appears in the m4a container - if (audioFormat == 'aac') { + if (audioFormat === 'aac') { profile.DirectPlayProfiles.push({ Container: 'm4a', AudioCodec: audioFormat, diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css index 84430d7bb2..2f135c2c19 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/card.css @@ -237,7 +237,7 @@ } .cardText { - padding: .25em .5em; + padding: .35em .5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 9c6e35b9b5..285c959c8b 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -1,5 +1,6 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo', 'focusManager', 'indicators', 'globalize', 'layoutManager', 'apphost', 'dom', 'emby-button', 'css!./card', 'paper-icon-button-light', 'clearButtonStyle'], function (datetime, imageLoader, connectionManager, itemHelper, mediaInfo, focusManager, indicators, globalize, layoutManager, appHost, dom) { + 'use strict'; // Regular Expressions for parsing tags and attributes var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, @@ -32,7 +33,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var apiClient = connectionManager.currentApiClient(); - if (arguments.length == 1) { + if (arguments.length === 1) { options = arguments[0]; items = options.items; @@ -48,54 +49,122 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo switch (shape) { case 'portrait': - if (screenWidth >= 2200) return 10; - if (screenWidth >= 2100) return 9; - if (screenWidth >= 1600) return 8; - if (screenWidth >= 1400) return 7; - if (screenWidth >= 1200) return 6; - if (screenWidth >= 800) return 5; - if (screenWidth >= 640) return 4; + if (screenWidth >= 2200) { + return 10; + } + if (screenWidth >= 2100) { + return 9; + } + if (screenWidth >= 1600) { + return 8; + } + if (screenWidth >= 1400) { + return 7; + } + if (screenWidth >= 1200) { + return 6; + } + if (screenWidth >= 800) { + return 5; + } + if (screenWidth >= 640) { + return 4; + } return 3; case 'square': - if (screenWidth >= 2100) return 9; - if (screenWidth >= 1800) return 8; - if (screenWidth >= 1400) return 7; - if (screenWidth >= 1200) return 6; - if (screenWidth >= 900) return 5; - if (screenWidth >= 700) return 4; - if (screenWidth >= 500) return 3; + if (screenWidth >= 2100) { + return 9; + } + if (screenWidth >= 1800) { + return 8; + } + if (screenWidth >= 1400) { + return 7; + } + if (screenWidth >= 1200) { + return 6; + } + if (screenWidth >= 900) { + return 5; + } + if (screenWidth >= 700) { + return 4; + } + if (screenWidth >= 500) { + return 3; + } return 2; case 'banner': - if (screenWidth >= 2200) return 4; - if (screenWidth >= 1200) return 3; - if (screenWidth >= 800) return 2; + if (screenWidth >= 2200) { + return 4; + } + if (screenWidth >= 1200) { + return 3; + } + if (screenWidth >= 800) { + return 2; + } return 1; case 'backdrop': - if (screenWidth >= 2500) return 6; - if (screenWidth >= 2100) return 5; - if (screenWidth >= 1200) return 4; - if (screenWidth >= 770) return 3; - if (screenWidth >= 420) return 2; + if (screenWidth >= 2500) { + return 6; + } + if (screenWidth >= 2100) { + return 5; + } + if (screenWidth >= 1200) { + return 4; + } + if (screenWidth >= 770) { + return 3; + } + if (screenWidth >= 420) { + return 2; + } return 1; case 'smallBackdrop': - if (screenWidth >= 1440) return 8; - if (screenWidth >= 1100) return 6; - if (screenWidth >= 800) return 5; - if (screenWidth >= 600) return 4; - if (screenWidth >= 540) return 3; - if (screenWidth >= 420) return 2; + if (screenWidth >= 1440) { + return 8; + } + if (screenWidth >= 1100) { + return 6; + } + if (screenWidth >= 800) { + return 5; + } + if (screenWidth >= 600) { + return 4; + } + if (screenWidth >= 540) { + return 3; + } + if (screenWidth >= 420) { + return 2; + } return 1; case 'overflowPortrait': - if (screenWidth >= 1000) return 100 / 23; - if (screenWidth >= 640) return 100 / 36; + if (screenWidth >= 1000) { + return 100 / 23; + } + if (screenWidth >= 640) { + return 100 / 36; + } return 2.5; case 'overflowSquare': - if (screenWidth >= 1000) return 100 / 22; - if (screenWidth >= 640) return 100 / 30; + if (screenWidth >= 1000) { + return 100 / 22; + } + if (screenWidth >= 640) { + return 100 / 30; + } return 100 / 42; case 'overflowBackdrop': - if (screenWidth >= 1000) return 100 / 40; - if (screenWidth >= 640) return 100 / 60; + if (screenWidth >= 1000) { + return 100 / 40; + } + if (screenWidth >= 640) { + return 100 / 60; + } return 100 / 84; default: return 4; @@ -142,29 +211,29 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var primaryImageAspectRatio = imageLoader.getPrimaryImageAspectRatio(items); - var isThumbAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.777777778) < .3; - var isSquareAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1) < .33 || - primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.3333334) < .01; + var isThumbAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.777777778) < 0.3; + var isSquareAspectRatio = primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1) < 0.33 || + primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 1.3333334) < 0.01; - if (options.shape == 'auto' || options.shape == 'autohome' || options.shape == 'autooverflow' || options.shape == 'autoVertical') { + if (options.shape === 'auto' || options.shape === 'autohome' || options.shape === 'autooverflow' || options.shape === 'autoVertical') { if (options.preferThumb === true || isThumbAspectRatio) { - options.shape = options.shape == 'autooverflow' ? 'overflowBackdrop' : 'backdrop'; + options.shape = options.shape === 'autooverflow' ? 'overflowBackdrop' : 'backdrop'; } else if (isSquareAspectRatio) { options.coverImage = true; - options.shape = options.shape == 'autooverflow' ? 'overflowSquare' : 'square'; + options.shape = options.shape === 'autooverflow' ? 'overflowSquare' : 'square'; } else if (primaryImageAspectRatio && primaryImageAspectRatio > 1.9) { options.shape = 'banner'; options.coverImage = true; - } else if (primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 0.6666667) < .2) { - options.shape = options.shape == 'autooverflow' ? 'overflowPortrait' : 'portrait'; + } else if (primaryImageAspectRatio && Math.abs(primaryImageAspectRatio - 0.6666667) < 0.2) { + options.shape = options.shape === 'autooverflow' ? 'overflowPortrait' : 'portrait'; } else { - options.shape = options.defaultShape || (options.shape == 'autooverflow' ? 'overflowSquare' : 'square'); + options.shape = options.defaultShape || (options.shape === 'autooverflow' ? 'overflowSquare' : 'square'); } } - if (options.preferThumb == 'auto') { - options.preferThumb = options.shape == 'backdrop' || options.shape == 'overflowBackdrop'; + if (options.preferThumb === 'auto') { + options.preferThumb = options.shape === 'backdrop' || options.shape === 'overflowBackdrop'; } options.uiAspect = getDesiredAspect(options.shape); @@ -179,13 +248,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (layoutManager.tv) { - if (options.shape == 'backdrop') { + if (options.shape === 'backdrop') { options.width = options.width || 500; } - else if (options.shape == 'portrait') { + else if (options.shape === 'portrait') { options.width = options.width || 243; } - else if (options.shape == 'square') { + else if (options.shape === 'square') { options.width = options.width || 243; } } @@ -197,13 +266,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var isVertical; - if (options.shape == 'autoVertical') { + if (options.shape === 'autoVertical') { isVertical = true; } setCardData(items, options); - if (options.indexBy == 'Genres') { + if (options.indexBy === 'Genres') { return buildCardsByGenreHtmlInternal(items, apiClient, options); } @@ -229,7 +298,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (options.indexBy) { var newIndexValue = ''; - if (options.indexBy == 'PremiereDate') { + if (options.indexBy === 'PremiereDate') { if (item.PremiereDate) { try { @@ -240,19 +309,19 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } } - else if (options.indexBy == 'Genres') { + else if (options.indexBy === 'Genres') { newIndexValue = item.Name; } - else if (options.indexBy == 'ProductionYear') { + else if (options.indexBy === 'ProductionYear') { newIndexValue = item.ProductionYear; } - else if (options.indexBy == 'CommunityRating') { - newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + (item.CommunityRating % 1 >= .5 ? .5 : 0)) + '+' : null; + else if (options.indexBy === 'CommunityRating') { + newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + (item.CommunityRating % 1 >= 0.5 ? 0.5 : 0)) + '+' : null; } - if (newIndexValue != currentIndexValue) { + if (newIndexValue !== currentIndexValue) { if (hasOpenRow) { html += ''; @@ -284,7 +353,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } } - if (options.rows && itemsInRow == 0) { + if (options.rows && itemsInRow === 0) { if (hasOpenRow) { html += ''; @@ -322,6 +391,19 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo return html; } + function filterItemsByGenre(items, genre) { + + var genreLower = genre.toLowerCase(); + return items.filter(function (currentItem) { + + return currentItem.Genres.filter(function (g) { + + return g.toLowerCase() === genreLower; + + }).length > 0; + }); + } + function buildCardsByGenreHtmlInternal(items, apiClient, options) { var className = 'card'; @@ -334,19 +416,43 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var loopItems = options.genres; + var itemsInRow; + var hasOpenRow; + + var onGenre = function (renderItem) { + + var currentItemHtml = ''; + + if (options.rows && itemsInRow === 0) { + + if (hasOpenRow) { + currentItemHtml += ''; + hasOpenRow = false; + } + + currentItemHtml += '
'; + hasOpenRow = true; + } + + var cardClass = className; + currentItemHtml += buildCard(i, renderItem, apiClient, options, cardClass); + + itemsInRow++; + + if (options.rows && itemsInRow >= options.rows) { + currentItemHtml += '
'; + hasOpenRow = false; + itemsInRow = 0; + } + + return currentItemHtml; + }; + for (var i = 0, length = loopItems.length; i < length; i++) { var item = loopItems[i]; - var genreLower = item.Name.toLowerCase(); - var renderItems = items.filter(function (currentItem) { - - return currentItem.Genres.filter(function (g) { - - return g.toLowerCase() == genreLower; - - }).length > 0; - }); + var renderItems = filterItemsByGenre(items, item.Name); if (!renderItems.length) { continue; @@ -361,39 +467,10 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo showMoreButton = true; } - var itemsInRow = 0; - var hasOpenRow = false; - - html += renderItems.map(function (renderItem) { - - var currentItemHtml = ''; - - if (options.rows && itemsInRow == 0) { - - if (hasOpenRow) { - currentItemHtml += ''; - hasOpenRow = false; - } - - currentItemHtml += '
'; - hasOpenRow = true; - } - - var cardClass = className; - currentItemHtml += buildCard(i, renderItem, apiClient, options, cardClass); - - itemsInRow++; - - if (options.rows && itemsInRow >= options.rows) { - currentItemHtml += '
'; - hasOpenRow = false; - itemsInRow = 0; - } - - return currentItemHtml; - - }).join(''); + itemsInRow = 0; + hasOpenRow = false; + html += renderItems.map(onGenre).join(''); if (showMoreButton) { html += '
'; @@ -412,13 +489,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (shape) { shape = shape.toLowerCase(); - if (shape.indexOf('portrait') != -1) { + if (shape.indexOf('portrait') !== -1) { return (2 / 3); } - if (shape.indexOf('backdrop') != -1) { + if (shape.indexOf('backdrop') !== -1) { return (16 / 9); } - if (shape.indexOf('square') != -1) { + if (shape.indexOf('square') !== -1) { return 1; } } @@ -436,6 +513,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var forceName = false; var imgUrl = null; var coverImage = false; + var uiAspect = null; if (options.preferThumb && item.ImageTags && item.ImageTags.Thumb) { @@ -495,9 +573,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (primaryImageAspectRatio) { - var uiAspect = getDesiredAspect(options.shape); + uiAspect = getDesiredAspect(options.shape); if (uiAspect) { - coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= .2; + coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= 0.2; } } @@ -517,9 +595,9 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (primaryImageAspectRatio) { - var uiAspect = getDesiredAspect(options.shape); + uiAspect = getDesiredAspect(options.shape); if (uiAspect) { - coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= .2; + coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= 0.2; } } } @@ -543,13 +621,13 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo }); if (primaryImageAspectRatio) { - var uiAspect = getDesiredAspect(options.shape); + uiAspect = getDesiredAspect(options.shape); if (uiAspect) { - coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= .2; + coverImage = Math.abs(primaryImageAspectRatio - uiAspect) <= 0.2; } } } - else if (item.Type == 'Season' && item.ImageTags && item.ImageTags.Thumb) { + else if (item.Type === 'Season' && item.ImageTags && item.ImageTags.Thumb) { imgUrl = apiClient.getScaledImageUrl(item.Id, { type: "Thumb", @@ -636,7 +714,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var text = lines[i]; - if (i == 1 && isOuterFooter) { + if (i === 1 && isOuterFooter) { cssClass += ' cardText-secondary'; } @@ -670,11 +748,11 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (isOuterFooter && options.cardLayout && !layoutManager.tv) { - if (options.cardFooterAside == 'logo') { + if (options.cardFooterAside === 'logo') { } - else if (options.cardFooterAside != 'none') { - var moreIcon = appHost.moreIcon == 'dots-horiz' ? '' : ''; + else if (options.cardFooterAside !== 'none') { + var moreIcon = appHost.moreIcon === 'dots-horiz' ? '' : ''; html += ''; } } @@ -682,12 +760,12 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var cssClass = options.centerText && !options.cardLayout ? "cardText cardTextCentered" : "cardText"; var lines = []; - var parentTitleUnderneath = item.Type == 'MusicAlbum' || item.Type == 'Audio' || item.Type == 'MusicVideo'; + var parentTitleUnderneath = item.Type === 'MusicAlbum' || item.Type === 'Audio' || item.Type === 'MusicVideo'; if (showOtherText) { if ((options.showParentTitle || options.showParentTitleOrTitle) && !parentTitleUnderneath) { - if (isOuterFooter && item.Type == 'Episode' && item.SeriesName && item.SeriesId) { + if (isOuterFooter && item.Type === 'Episode' && item.SeriesName && item.SeriesId) { lines.push(getTextActionButton({ Id: item.SeriesId, @@ -698,7 +776,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } else { - var parentTitle = item.Type == 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""); + var parentTitle = item.Type === 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || ""); if (parentTitle || options.showParentTitle) { lines.push(parentTitle); @@ -709,7 +787,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (showTitle || forceName || (options.showParentTitleOrTitle && !lines.length)) { - var name = options.showTitle == 'auto' && !item.IsFolder && item.MediaType == 'Photo' ? '' : itemHelper.getDisplayName(item); + var name = options.showTitle === 'auto' && !item.IsFolder && item.MediaType === 'Photo' ? '' : itemHelper.getDisplayName(item); lines.push(htmlEncode(name)); } @@ -722,7 +800,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo item.AlbumArtists[0].IsFolder = true; lines.push(getTextActionButton(item.AlbumArtists[0])); } else { - lines.push(item.Type == 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "")); + lines.push(item.Type === 'Program' ? item.Name : (item.SeriesName || item.Album || item.AlbumArtist || item.GameSystem || "")); } } @@ -745,7 +823,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var songLine = ''; if (item.SongCount) { - songLine = item.SongCount == 1 ? + songLine = item.SongCount === 1 ? globalize.translate('sharedcomponents#ValueOneSong') : globalize.translate('sharedcomponents#ValueSongCount', item.SongCount); } @@ -842,7 +920,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } } - if (options.showCurrentProgram && item.Type == 'TvChannel') { + if (options.showCurrentProgram && item.Type === 'TvChannel') { if (item.CurrentProgram) { lines.push(item.CurrentProgram.Name); @@ -853,7 +931,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (options.showSeriesYear) { - if (item.Status == "Continuing") { + if (item.Status === "Continuing") { lines.push(globalize.translate('sharedcomponents#SeriesYearToPresent', item.ProductionYear || '')); @@ -862,9 +940,27 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } } + + if (options.showSeriesTimerTime) { + if (item.RecordAnyTime) { + + lines.push(globalize.translate('sharedcomponents#Anytime')); + } else { + lines.push(datetime.getDisplayTime(item.StartDate)); + } + } + + if (options.showSeriesTimerChannel) { + if (item.RecordAnyChannel) { + lines.push(globalize.translate('sharedcomponents#AllChannels')); + } + else if (item.ChannelId) { + lines.push(item.ChannelName || ''); + } + } } - if ((showTitle || !imgUrl) && forceName && overlayText && lines.length == 1) { + if ((showTitle || !imgUrl) && forceName && overlayText && lines.length === 1) { lines = []; } @@ -903,7 +999,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var childText; - if (item.Type == 'Playlist') { + if (item.Type === 'Playlist') { childText = ''; @@ -922,11 +1018,11 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo counts.push(childText); } - else if (item.Type == 'Genre' || item.Type == 'Studio') { + else if (item.Type === 'Genre' || item.Type === 'Studio') { if (item.MovieCount) { - childText = item.MovieCount == 1 ? + childText = item.MovieCount === 1 ? globalize.translate('sharedcomponents#ValueOneMovie') : globalize.translate('sharedcomponents#ValueMovieCount', item.MovieCount); @@ -935,7 +1031,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (item.SeriesCount) { - childText = item.SeriesCount == 1 ? + childText = item.SeriesCount === 1 ? globalize.translate('sharedcomponents#ValueOneSeries') : globalize.translate('sharedcomponents#ValueSeriesCount', item.SeriesCount); @@ -943,7 +1039,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (item.EpisodeCount) { - childText = item.EpisodeCount == 1 ? + childText = item.EpisodeCount === 1 ? globalize.translate('sharedcomponents#ValueOneEpisode') : globalize.translate('sharedcomponents#ValueEpisodeCount', item.EpisodeCount); @@ -951,28 +1047,28 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (item.GameCount) { - childText = item.GameCount == 1 ? + childText = item.GameCount === 1 ? globalize.translate('sharedcomponents#ValueOneGame') : globalize.translate('sharedcomponents#ValueGameCount', item.GameCount); counts.push(childText); } - } else if (item.Type == 'GameGenre') { + } else if (item.Type === 'GameGenre') { if (item.GameCount) { - childText = item.GameCount == 1 ? + childText = item.GameCount === 1 ? globalize.translate('sharedcomponents#ValueOneGame') : globalize.translate('sharedcomponents#ValueGameCount', item.GameCount); counts.push(childText); } - } else if (item.Type == 'MusicGenre' || options.context == "MusicArtist") { + } else if (item.Type === 'MusicGenre' || options.context === "MusicArtist") { if (item.AlbumCount) { - childText = item.AlbumCount == 1 ? + childText = item.AlbumCount === 1 ? globalize.translate('sharedcomponents#ValueOneAlbum') : globalize.translate('sharedcomponents#ValueAlbumCount', item.AlbumCount); @@ -980,7 +1076,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (item.SongCount) { - childText = item.SongCount == 1 ? + childText = item.SongCount === 1 ? globalize.translate('sharedcomponents#ValueOneSong') : globalize.translate('sharedcomponents#ValueSongCount', item.SongCount); @@ -988,16 +1084,16 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (item.MusicVideoCount) { - childText = item.MusicVideoCount == 1 ? + childText = item.MusicVideoCount === 1 ? globalize.translate('sharedcomponents#ValueOneMusicVideo') : globalize.translate('sharedcomponents#ValueMusicVideoCount', item.MusicVideoCount); counts.push(childText); } - } else if (item.Type == 'Series') { + } else if (item.Type === 'Series') { - childText = item.RecursiveItemCount == 1 ? + childText = item.RecursiveItemCount === 1 ? globalize.translate('sharedcomponents#ValueOneEpisode') : globalize.translate('sharedcomponents#ValueEpisodeCount', item.RecursiveItemCount); @@ -1021,7 +1117,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var forceName = imgInfo.forceName || !imgUrl; - var showTitle = options.showTitle == 'auto' ? true : (options.showTitle || item.Type == 'PhotoAlbum' || item.Type == 'Folder'); + var showTitle = options.showTitle === 'auto' ? true : (options.showTitle || item.Type === 'PhotoAlbum' || item.Type === 'Folder'); var overlayText = options.overlayText; if (forceName && !options.cardLayout) { @@ -1035,7 +1131,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (options.coverImage || imgInfo.coverImage) { cardImageContainerClass += ' coveredImage'; - if (item.MediaType == 'Photo' || item.Type == 'PhotoAlbum' || item.Type == 'Folder' || item.ProgramInfo || item.Type == 'Program') { + if (item.MediaType === 'Photo' || item.Type === 'PhotoAlbum' || item.Type === 'Folder' || item.ProgramInfo || item.Type === 'Program') { cardImageContainerClass += ' coveredImage-noScale'; } } @@ -1099,15 +1195,15 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var overlayPlayButton = options.overlayPlayButton; if (overlayPlayButton == null && !options.overlayMoreButton && !options.cardLayout) { - overlayPlayButton = item.MediaType == 'Video'; + overlayPlayButton = item.MediaType === 'Video'; } - if (overlayPlayButton && !item.IsPlaceHolder && (item.LocationType != 'Virtual' || !item.MediaType || item.Type == 'Program') && item.Type != 'Person' && item.PlayAccess == 'Full') { + if (overlayPlayButton && !item.IsPlaceHolder && (item.LocationType !== 'Virtual' || !item.MediaType || item.Type === 'Program') && item.Type !== 'Person' && item.PlayAccess === 'Full') { overlayButtons += ''; } if (options.overlayMoreButton) { - var moreIcon = appHost.moreIcon == 'dots-horiz' ? '' : ''; + var moreIcon = appHost.moreIcon === 'dots-horiz' ? '' : ''; overlayButtons += ''; } @@ -1175,7 +1271,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } if (!imgUrl) { - var defaultName = item.Type == 'Program' ? item.Name : itemHelper.getDisplayName(item); + var defaultName = item.Type === 'Program' ? item.Name : itemHelper.getDisplayName(item); cardImageContainerOpen += '
' + defaultName + '
'; } @@ -1197,14 +1293,14 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var actionAttribute; - if (tagName == 'button') { + if (tagName === 'button') { className += " itemAction"; actionAttribute = ' data-action="' + action + '"'; } else { actionAttribute = ''; } - if (item.Type != 'MusicAlbum' && item.Type != 'MusicArtist' && item.Type != 'Audio') { + if (item.Type !== 'MusicAlbum' && item.Type !== 'MusicArtist' && item.Type !== 'Audio') { className += ' card-withuserdata'; } @@ -1216,10 +1312,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo var channelIdData = item.ChannelId ? (' data-channelid="' + item.ChannelId + '"') : ''; var contextData = options.context ? (' data-context="' + options.context + '"') : ''; - return '\ -<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + positionTicksData + collectionIdData + playlistIdData + contextData + ' data-prefix="' + prefix + '" class="' + className + '"> \ -' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + cardContentClose + overlayButtons + cardScalableClose + outerCardFooter + cardBoxClose + '\ -'; + return '<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + positionTicksData + collectionIdData + playlistIdData + contextData + ' data-prefix="' + prefix + '" class="' + className + '">' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + cardContentClose + overlayButtons + cardScalableClose + outerCardFooter + cardBoxClose + ''; } function buildCards(items, options) { @@ -1244,7 +1337,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (html) { - if (options.itemsContainer.cardBuilderHtml != html) { + if (options.itemsContainer.cardBuilderHtml !== html) { options.itemsContainer.innerHTML = html; if (items.length < 50) { @@ -1265,7 +1358,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo focusManager.autoFocus(options.itemsContainer, true); } - if (options.indexBy == 'Genres') { + if (options.indexBy === 'Genres') { options.itemsContainer.addEventListener('click', onItemsContainerClick); } } @@ -1321,12 +1414,15 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo function updateUserData(card, userData) { var type = card.getAttribute('data-type'); - var enableCountIndicator = type == 'Series' || type == 'BoxSet' || type == 'Season'; - var indicatorsElem; + var enableCountIndicator = type === 'Series' || type === 'BoxSet' || type === 'Season'; + var indicatorsElem = null; + var playedIndicator = null; + var countIndicator = null; + var itemProgressBar = null; if (userData.Played) { - var playedIndicator = card.querySelector('.playedIndicator'); + playedIndicator = card.querySelector('.playedIndicator'); if (!playedIndicator) { @@ -1338,14 +1434,14 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo playedIndicator.innerHTML = 'check'; } else { - var playedIndicator = card.querySelector('.playedIndicator'); + playedIndicator = card.querySelector('.playedIndicator'); if (playedIndicator) { playedIndicator.parentNode.removeChild(playedIndicator); } } if (userData.UnplayedItemCount) { - var countIndicator = card.querySelector('.countIndicator'); + countIndicator = card.querySelector('.countIndicator'); if (!countIndicator) { @@ -1357,7 +1453,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo countIndicator.innerHTML = userData.UnplayedItemCount; } else if (enableCountIndicator) { - var countIndicator = card.querySelector('.countIndicator'); + countIndicator = card.querySelector('.countIndicator'); if (countIndicator) { countIndicator.parentNode.removeChild(countIndicator); @@ -1372,7 +1468,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo if (progressHtml) { - var itemProgressBar = card.querySelector('.itemProgressBar'); + itemProgressBar = card.querySelector('.itemProgressBar'); if (!itemProgressBar) { itemProgressBar = document.createElement('div'); @@ -1392,7 +1488,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } else { - var itemProgressBar = card.querySelector('.itemProgressBar'); + itemProgressBar = card.querySelector('.itemProgressBar'); if (itemProgressBar) { itemProgressBar.parentNode.removeChild(itemProgressBar); } diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js index 9a340df5d3..921561bbef 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/chaptercardbuilder.js @@ -1,4 +1,5 @@ define(['datetime', 'imageLoader', 'connectionManager', 'layoutManager'], function (datetime, imageLoader, connectionManager, layoutManager) { + 'use strict'; function buildChapterCardsHtml(item, chapters, options) { @@ -6,7 +7,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'layoutManager'], functi var mediaStreams = ((item.MediaSources || [])[0] || {}).MediaStreams || []; var videoStream = mediaStreams.filter(function (i) { - return i.Type == 'Video'; + return i.Type === 'Video'; })[0] || {}; var shape = (options.backdropShape || 'backdrop'); @@ -32,7 +33,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'layoutManager'], functi for (var i = 0, length = chapters.length; i < length; i++) { - if (options.rows && itemsInRow == 0) { + if (options.rows && itemsInRow === 0) { html += '
'; } @@ -91,22 +92,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'layoutManager'], functi cardBoxCssClass += ' cardBox-focustransform'; } - var html = '\ -
\ -' - ; + var html = '
'; return html; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js index 656cd6da9e..bfd46056b5 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/peoplecardbuilder.js @@ -1,4 +1,5 @@ define(['imageLoader', 'itemShortcuts', 'connectionManager', 'layoutManager'], function (imageLoader, itemShortcuts, connectionManager, layoutManager) { + 'use strict'; function buildPeopleCardsHtml(people, options) { @@ -16,7 +17,7 @@ define(['imageLoader', 'itemShortcuts', 'connectionManager', 'layoutManager'], f for (var i = 0, length = people.length; i < length; i++) { - if (options.rows && itemsInRow == 0) { + if (options.rows && itemsInRow === 0) { html += '
'; } @@ -84,22 +85,7 @@ define(['imageLoader', 'itemShortcuts', 'connectionManager', 'layoutManager'], f cardBoxCssClass += ' cardBox-focustransform'; } - var html = '\ -
\ -' - ; + var html = ''; return html; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index 9774a187c2..c456606c25 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -437,6 +437,8 @@ if (enableColorCodedBackgrounds && accentCssClass) { cssClass += ' ' + accentCssClass; + accentCssClass = null; + } else { accentCssClass = null; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js b/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js index 8c52bda358..2f5603f950 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js +++ b/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js @@ -98,8 +98,8 @@ define(['css!./indicators.css', 'material-icons'], function () { function getTimerIndicator(item) { - if (item.SeriesTimerId) { - if (item.TimerId || item.Type == 'Timer') { + if (item.SeriesTimerId || item.Type == 'SeriesTimer') { + if (item.TimerId || item.Type == 'Timer' || item.Type == 'SeriesTimer') { return ''; } else { return ''; diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index ea2db09cc0..624b7ecffd 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -29,7 +29,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', }); } - if (item.Type == 'Timer' && user.Policy.EnableLiveTvManagement) { + if ((item.Type == 'Timer') && user.Policy.EnableLiveTvManagement) { commands.push({ name: globalize.translate('sharedcomponents#ButtonCancel'), id: 'canceltimer' @@ -53,9 +53,9 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', if (itemHelper.canEdit(user, item.Type)) { - if (options.edit !== false) { + if (options.edit !== false && item.Type != 'SeriesTimer') { - var text = item.Type == 'Timer' ? globalize.translate('sharedcomponents#Edit') : globalize.translate('sharedcomponents#EditInfo'); + var text = (item.Type == 'Timer' || item.Type == 'SeriesTimer') ? globalize.translate('sharedcomponents#Edit') : globalize.translate('sharedcomponents#EditInfo'); commands.push({ name: text, @@ -120,15 +120,6 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } } - //if (options.open !== false) { - // if (item.Type != 'Timer' && item.Type != 'Audio') { - // commands.push({ - // name: globalize.translate('sharedcomponents#Open'), - // id: 'open' - // }); - // } - //} - if (canPlay) { if (options.play !== false) { commands.push({ @@ -178,7 +169,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', if (user.Policy.IsAdministrator) { - if (item.Type != 'Timer' && item.Type != 'Program') { + if (item.Type != 'Timer' && item.Type != 'SeriesTimer' && item.Type != 'Program') { commands.push({ name: globalize.translate('sharedcomponents#Refresh'), id: 'refresh' @@ -503,7 +494,11 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', loading.show(); - apiClient.cancelLiveTvTimer(item.Id).then(function () { + var promise = item.Type == 'SeriesTimer' ? + apiClient.cancelLiveTvSeriesTimer(item.Id) : + apiClient.cancelLiveTvTimer(item.Id); + + promise.then(function () { require(['toast'], function (toast) { toast(globalize.translate('sharedcomponents#RecordingCancelled')); @@ -547,6 +542,11 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', if (item.Type == 'Timer') { require(['recordingEditor'], function (recordingEditor) { + recordingEditor.show(item.Id, serverId).then(resolve, reject); + }); + } else if (item.Type == 'SeriesTimer') { + require(['seriesRecordingEditor'], function (recordingEditor) { + recordingEditor.show(item.Id, serverId).then(resolve, reject); }); } else { @@ -602,6 +602,10 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', return getCommands(options).then(function (commands) { + if (!commands.length) { + return Promise.reject(); + } + return new Promise(function (resolve, reject) { require(['actionsheet'], function (actionSheet) { diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js index 43cde58260..55f1c12691 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js @@ -46,7 +46,7 @@ define(['apphost'], function (appHost) { function supportsAddingToCollection(item) { - if (item.Type == 'Timer') { + if (item.Type == 'Timer' || item.Type == 'SeriesTimer') { return false; } @@ -62,6 +62,9 @@ define(['apphost'], function (appHost) { if (item.Type == 'Timer') { return false; } + if (item.Type == 'SeriesTimer') { + return false; + } return item.RunTimeTicks || item.IsFolder || item.Type == "Genre" || item.Type == "MusicGenre" || item.Type == "MusicArtist"; } @@ -122,7 +125,7 @@ define(['apphost'], function (appHost) { return false; } - return itemType != 'Timer' && canEdit(user, itemType); + return itemType != 'Timer' && itemType != 'SeriesTimer' && canEdit(user, itemType); }, canSync: function (user, item) { @@ -139,6 +142,9 @@ define(['apphost'], function (appHost) { if (item.Type == 'Timer') { return false; } + if (item.Type == 'SeriesTimer') { + return false; + } return user.Policy.EnablePublicSharing && appHost.supports('sharing'); } }; diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js index 53c11559c0..13125ab0b7 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemhovermenu/itemhovermenu.js @@ -191,7 +191,7 @@ var id = dataElement.getAttribute('data-id'); var type = dataElement.getAttribute('data-type'); - if (type == 'Timer') { + if (type == 'Timer' || type == 'SeriesTimer') { return; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css index 2f08d54e69..5e3fb6369f 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css +++ b/dashboard-ui/bower_components/emby-webcomponents/listview/listview.css @@ -16,7 +16,7 @@ } .listItem-border { - border-bottom: 1px solid #2a2a2a; + border-bottom: 1px solid #262626; } .listItem-button { @@ -55,13 +55,12 @@ .listItemBody { flex-grow: 1; - padding: 0 1em; + padding: .8em 1em; overflow: hidden; text-overflow: ellipsis; flex-direction: column; vertical-align: middle; justify-content: center; - min-height: 3.44em; } .listItemBody-nogrow { diff --git a/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js b/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js index 5374d125a3..91ffb056b4 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js +++ b/dashboard-ui/bower_components/emby-webcomponents/mediainfo/mediainfo.js @@ -41,8 +41,8 @@ define(['datetime', 'globalize', 'embyRouter', 'itemHelper', 'material-icons', ' } if (options.timerIndicator !== false) { - if (item.SeriesTimerId) { - if (item.TimerId || item.Type == 'Timer') { + if (item.SeriesTimerId || item.Type == 'SeriesTimer') { + if (item.TimerId || item.Type == 'Timer' || item.Type == 'SeriesTimer') { miscInfo.push({ html: '' }); diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css index 234a4233b8..6d5969d97c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingcreator.css @@ -5,6 +5,7 @@ .recordingDialog-imageContainer { flex-shrink: 0; padding: 1em 1em 1em 0; + min-width: 17%; max-width: 25%; } diff --git a/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js b/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js index 863bf1f02b..41f0d204be 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js +++ b/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js @@ -111,6 +111,9 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g if (type == 'Timer') { return apiClient.getLiveTvTimer(id); } + if (type == 'SeriesTimer') { + return apiClient.getLiveTvSeriesTimer(id); + } return apiClient.getItem(apiClient.getCurrentUserId(), id); }