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

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2015-03-08 12:25:46 -04:00
(function ($, document) {
function reloadList(page) {
Dashboard.showLoadingMsg();
var promise1 = ApiClient.getAvailablePlugins({
TargetSystems: 'Server'
});
var promise2 = ApiClient.getInstalledPlugins();
$.when(promise1, promise2).done(function (response1, response2) {
2015-03-08 13:58:45 -04:00
renderInstalled(page, response1[0], response2[0]);
renderCatalog(page, response1[0], response2[0]);
2015-03-08 12:25:46 -04:00
});
}
2015-03-08 13:58:45 -04:00
function renderInstalled(page, availablePlugins, installedPlugins) {
installedPlugins = installedPlugins.filter(function (i) {
var catalogEntry = availablePlugins.filter(function (a) {
return a.guid == i.Id;
})[0];
return catalogEntry && catalogEntry.category == 'Sync';
});
PluginsPage.renderPlugins(page, installedPlugins);
}
function renderCatalog(page, availablePlugins, installedPlugins) {
2015-03-08 12:25:46 -04:00
PluginCatalog.renderCatalog({
catalogElement: $('.catalog', page),
availablePlugins: availablePlugins,
installedPlugins: installedPlugins,
categories: ['Sync'],
2015-03-08 13:34:02 -04:00
showCategory: false,
context: 'sync'
2015-03-08 12:25:46 -04:00
});
}
$(document).on('pageshow', "#syncServicesPage", function () {
var page = this;
reloadList(page);
});
})(jQuery, document);