1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

trim loaded sync scripts

This commit is contained in:
Luke Pulverenti 2016-02-17 23:57:19 -05:00
parent f220653d1b
commit c49de6a93e
6 changed files with 124 additions and 121 deletions

View file

@ -809,7 +809,7 @@
commands.push('refresh');
}
if (SyncManager.isAvailable(item, user)) {
if (LibraryBrowser.enableSync(item, user)) {
commands.push('sync');
}
@ -1581,6 +1581,18 @@
return !item.CollectionType && invalidTypes.indexOf(item.Type) == -1 && item.MediaType != 'Photo';
},
enableSync: function(item, user) {
if (AppInfo.isNativeApp && !Dashboard.capabilities().SupportsSync) {
return false;
}
if (user && !user.Policy.EnableSync) {
return false;
}
return item.SupportsSync;
},
getItemCommands: function (item, options) {
var itemCommands = [];
@ -1633,7 +1645,7 @@
itemCommands.push('delete');
}
if (SyncManager.isAvailable(item)) {
if (LibraryBrowser.enableSync(item)) {
itemCommands.push('sync');
}