EmbyCrackedClient/web/native/interop/localsync.js
2025-06-25 11:46:04 +08:00

31 lines
No EOL
717 B
JavaScript

define(['events'], function (events) {
'use strict';
var localSync = {
sync: function () {
NativeSync.startSync();
},
setProgressUpdatesEnabled: function (enabled) {
// tell native code to start or stop sending updates to the UI
},
onProgress: function (numItems, numItemsComplete, totalPercentComplete) {
events.trigger(localSync, 'progress', [{
numItems: numItems,
numItemsComplete: numItemsComplete,
totalPercentComplete: totalPercentComplete
}]);
}
};
// native code can call this
window.LocalSync = localSync;
return localSync;
});