mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
reduce rescanning due to IsOffline
This commit is contained in:
parent
521b20f86a
commit
cbca3a20ae
23 changed files with 115 additions and 68 deletions
|
@ -49,7 +49,17 @@ define(['appStorage', 'browser'], function (appStorage, browser) {
|
|||
function getDeviceName() {
|
||||
var deviceName;
|
||||
|
||||
if (browser.chrome) {
|
||||
if (browser.tizen) {
|
||||
deviceName = "Samsung Smart TV";
|
||||
} else if (browser.web0S) {
|
||||
deviceName = "LG Smart TV";
|
||||
} else if (browser.operaTv) {
|
||||
deviceName = "Opera TV";
|
||||
} else if (browser.xboxOne) {
|
||||
deviceName = "Xbox One";
|
||||
} else if (browser.ps4) {
|
||||
deviceName = "Sony PS4";
|
||||
} else if (browser.chrome) {
|
||||
deviceName = "Chrome";
|
||||
} else if (browser.edge) {
|
||||
deviceName = "Edge";
|
||||
|
@ -77,6 +87,11 @@ define(['appStorage', 'browser'], function (appStorage, browser) {
|
|||
}
|
||||
|
||||
function supportsVoiceInput() {
|
||||
|
||||
if (browser.tv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return window.SpeechRecognition ||
|
||||
window.webkitSpeechRecognition ||
|
||||
window.mozSpeechRecognition ||
|
||||
|
@ -95,24 +110,57 @@ define(['appStorage', 'browser'], function (appStorage, browser) {
|
|||
alert('setWindowState is not supported and should not be called');
|
||||
},
|
||||
exit: function () {
|
||||
alert('exit is not supported and should not be called');
|
||||
|
||||
if (browser.tizen) {
|
||||
try {
|
||||
tizen.application.getCurrentApplication().exit();
|
||||
} catch (err) {
|
||||
console.log('error closing application: ' + err);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
window.close();
|
||||
},
|
||||
supports: function (command) {
|
||||
|
||||
var features = [
|
||||
'filedownload',
|
||||
'externalpremium',
|
||||
'sharing'
|
||||
'sharing',
|
||||
'externalpremium'
|
||||
];
|
||||
|
||||
features.push('externallinks');
|
||||
if (browser.operaTv || browser.tizen || browser.web0s) {
|
||||
features.push('exit');
|
||||
} else {
|
||||
features.push('exitmenu');
|
||||
}
|
||||
|
||||
if (!browser.operaTv) {
|
||||
features.push('externallinks');
|
||||
}
|
||||
|
||||
if (supportsVoiceInput()) {
|
||||
features.push('voiceinput');
|
||||
}
|
||||
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (!browser.mobile || userAgent.indexOf('msapphost') != -1) {
|
||||
features.push('htmlaudioautoplay');
|
||||
features.push('htmlvideoautoplay');
|
||||
}
|
||||
|
||||
return features.indexOf(command.toLowerCase()) != -1;
|
||||
},
|
||||
unlockedFeatures: function () {
|
||||
|
||||
var features = [];
|
||||
|
||||
features.push('playback');
|
||||
|
||||
return features;
|
||||
},
|
||||
appInfo: function () {
|
||||
|
||||
if (appInfo) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue