jellyfin-web/dashboard-ui/scripts/localsync.js
2017-01-27 22:16:59 -05:00

1 line
571 B
JavaScript

define(["appSettings","connectionManager"],function(appSettings,connectionManager){"use strict";var syncPromise;return{sync:function(options){return syncPromise?syncPromise.promise():new Promise(function(resolve,reject){require(["multiserversync"],function(MultiServerSync){options=options||{},options.cameraUploadServers=appSettings.cameraUploadServers(),syncPromise=new MultiServerSync(connectionManager).sync(options).then(function(){syncPromise=null,resolve()},function(){syncPromise=null})})})},getSyncStatus:function(){return null!=syncPromise?"Syncing":"Idle"}}});