diff --git a/dashboard-ui/components/servertestermessage.js b/dashboard-ui/components/servertestermessage.js index c65fcab7fd..e4e1ab4e5f 100644 --- a/dashboard-ui/components/servertestermessage.js +++ b/dashboard-ui/components/servertestermessage.js @@ -145,7 +145,7 @@ apiClient.getPublicSystemInfo().then(function (info) { - if (compareVersions(info.Version, '3.0.5913') == 1) { + if (compareVersions(info.Version, '3.0.5930') == 1) { showInternal(); } }); diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js index 335ef5d570..f42b4be80e 100644 --- a/dashboard-ui/scripts/sections.js +++ b/dashboard-ui/scripts/sections.js @@ -172,6 +172,14 @@ }); } + /** + * Returns a random integer between min (inclusive) and max (inclusive) + * Using Math.round() will give you a non-uniform distribution! + */ + function getRandomInt(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; + } + function getAppInfo() { if (AppInfo.nativeApp) { @@ -183,11 +191,6 @@ return Promise.resolve(''); } - function getCard(img) { - - return '
'; - } - return Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) { appSettings.set(cacheKey, new Date().getTime()); @@ -196,24 +199,51 @@ return ''; } - var html = ''; - html += '
'; - html += '

Try Emby Theater

'; - html += '

A beautiful app for your TV and large screen tablet. Emby Theater runs on Windows, Xbox One, Google Chrome, FireFox, Microsoft Edge and Opera.

'; - html += '
'; - html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png'); - html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png'); - html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png'); - html += '
'; - html += '
'; - html += '
'; + var infos = [getTheaterInfo, getPremiereInfo]; appSettings.set(cacheKey, new Date().getTime()); - return html; + return infos[getRandomInt(0, 1)](); }); } + function getCard(img, target) { + + return '
'; + } + + function getTheaterInfo() { + + var html = ''; + html += '
'; + html += '

Try Emby Theater

'; + html += '

A beautiful app for your TV and large screen tablet. Emby Theater runs on Windows, Xbox One, Google Chrome, FireFox, Microsoft Edge and Opera.

'; + html += '
'; + html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png', 'https://emby.media/download'); + html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png', 'https://emby.media/download'); + html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png', 'https://emby.media/download'); + html += '
'; + html += '
'; + html += '
'; + return html; + } + + function getPremiereInfo() { + + var html = ''; + html += '
'; + html += '

Try Emby Premiere

'; + html += '

Design beautiful Cover Art, enjoy free access to Emby apps, and more. Learn more

'; + html += '
'; + html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater1.png', 'https://emby.media/premiere'); + html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater2.png', 'https://emby.media/premiere'); + html += getCard('https://raw.githubusercontent.com/MediaBrowser/Emby.Resources/master/apps/theater3.png', 'https://emby.media/premiere'); + html += '
'; + html += '
'; + html += '
'; + return html; + } + function loadRecentlyAdded(elem, user) { var limit = AppInfo.hasLowImageBandwidth ?