mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
sync updates
This commit is contained in:
parent
47d9d8259e
commit
d3b42303eb
@ -347,6 +347,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mediaSource.Protocol == 'Http') {
|
||||
if (Dashboard.isConnectMode()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (extension == 'm4v' || extension == 'mkv') {
|
||||
return $.browser.chrome != null;
|
||||
}
|
||||
|
@ -126,6 +126,21 @@ var Dashboard = {
|
||||
var address = store.getItem('serverAddress');
|
||||
|
||||
if (!address && !Dashboard.isConnectMode()) {
|
||||
|
||||
// Try to get the server address from the browser url
|
||||
// This will preserve protocol, hostname, port and subdirectory
|
||||
var urlLower = getWindowUrl().toLowerCase();
|
||||
var index = urlLower.indexOf('/web');
|
||||
if (index == -1) {
|
||||
index = urlLower.index('/dashboard');
|
||||
}
|
||||
|
||||
if (index != -1) {
|
||||
address = urlLower.substring(0, index);
|
||||
return address;
|
||||
}
|
||||
|
||||
// If the above failed, just piece it together manually
|
||||
var loc = window.location;
|
||||
|
||||
address = loc.protocol + '//' + loc.hostname;
|
||||
|
@ -110,7 +110,10 @@
|
||||
|
||||
}).join('');
|
||||
html += '</select>';
|
||||
|
||||
if (!targets.length) {
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('LabelSyncNoTargetsHelp') + '</div>';
|
||||
html += '<div class="fieldDescription"><a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank">' + Globalize.translate('ButtonLearnMore') + '</a></div>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '<br/>';
|
||||
@ -187,33 +190,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
function showUnwatchedFilter(items) {
|
||||
|
||||
return items.filter(function (i) {
|
||||
|
||||
return i.MediaType == "Video" || i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist";
|
||||
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
function showItemLimit(items) {
|
||||
|
||||
return items.length > 1 || items.filter(function (i) {
|
||||
|
||||
return i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist";
|
||||
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
function showSyncNew(items) {
|
||||
|
||||
return items.filter(function (i) {
|
||||
|
||||
return i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist";
|
||||
|
||||
}).length > 0;
|
||||
}
|
||||
|
||||
function isAvailable(item, user) {
|
||||
|
||||
return item.SupportsSync;
|
||||
|
@ -47,11 +47,6 @@
|
||||
return serverAddress;
|
||||
};
|
||||
|
||||
self.apiPrefix = function () {
|
||||
|
||||
return "";
|
||||
};
|
||||
|
||||
self.serverInfo = function (info) {
|
||||
|
||||
serverInfo = info || serverInfo;
|
||||
@ -311,9 +306,7 @@
|
||||
throw new Error("Url name cannot be empty");
|
||||
}
|
||||
|
||||
var url = serverAddress;
|
||||
|
||||
url += self.apiPrefix() + "/" + name;
|
||||
var url = serverAddress + "/" + name;
|
||||
|
||||
if (params) {
|
||||
url += "?" + $.param(params);
|
||||
@ -341,9 +334,7 @@
|
||||
|
||||
self.openWebSocket = function () {
|
||||
|
||||
var url = serverAddress + self.apiPrefix();
|
||||
|
||||
url = url.replace('http', 'ws');
|
||||
var url = serverAddress.replace('http', 'ws');
|
||||
|
||||
webSocket = new WebSocket(url);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user