diff --git a/src/bower_components/emby-apiclient/cameraroll.js b/src/bower_components/emby-apiclient/cameraroll.js deleted file mode 100644 index fddd1a1850..0000000000 --- a/src/bower_components/emby-apiclient/cameraroll.js +++ /dev/null @@ -1,8 +0,0 @@ -define([], function() { - "use strict"; - - function CameraRoll() {} - return CameraRoll.prototype.getFiles = function() { - return Promise.resolve([]) - }, new CameraRoll -}); \ No newline at end of file diff --git a/src/bower_components/emby-apiclient/sync/contentuploader.js b/src/bower_components/emby-apiclient/sync/contentuploader.js deleted file mode 100644 index e08dbe4dd2..0000000000 --- a/src/bower_components/emby-apiclient/sync/contentuploader.js +++ /dev/null @@ -1,57 +0,0 @@ -define(["localassetmanager", "cameraRoll"], function(localAssetManager, cameraRoll) { - "use strict"; - - function getFilesToUpload(files, uploadHistory) { - return files.filter(function(file) { - if (!file) return !1; - var uploadId = getUploadId(file); - return 0 === uploadHistory.FilesUploaded.filter(function(u) { - return uploadId === u.Id - }).length - }) - } - - function getUploadId(file) { - return btoa(file.Id + "1") - } - - function uploadNext(files, index, server, apiClient, resolve, reject) { - var length = files.length; - if (index >= length) return void resolve(); - uploadFile(files[index], apiClient).then(function() { - uploadNext(files, index + 1, server, apiClient, resolve, reject) - }, function() { - uploadNext(files, index + 1, server, apiClient, resolve, reject) - }) - } - - function uploadFile(file, apiClient) { - return new Promise(function(resolve, reject) { - require(["fileupload"], function(FileUpload) { - var url = apiClient.getUrl("Devices/CameraUploads", { - DeviceId: apiClient.deviceId(), - Name: file.Name, - Album: "Camera Roll", - Id: getUploadId(file), - api_key: apiClient.accessToken() - }); - console.log("Uploading file to " + url), (new FileUpload).upload(file, url).then(resolve, reject) - }) - }) - } - - function ContentUploader() {} - return ContentUploader.prototype.uploadImages = function(connectionManager, server) { - return cameraRoll.getFiles().then(function(photos) { - if (!photos.length) return Promise.resolve(); - var apiClient = connectionManager.getApiClient(server.Id); - return apiClient.getContentUploadHistory().then(function(uploadHistory) { - return photos = getFilesToUpload(photos, uploadHistory), console.log("Found " + photos.length + " files to upload"), new Promise(function(resolve, reject) { - uploadNext(photos, 0, server, apiClient, resolve, reject) - }) - }, function() { - return Promise.resolve() - }) - }) - }, ContentUploader -}); \ No newline at end of file diff --git a/src/bower_components/emby-apiclient/sync/serversync.js b/src/bower_components/emby-apiclient/sync/serversync.js index 4299091c27..dacc70f73c 100644 --- a/src/bower_components/emby-apiclient/sync/serversync.js +++ b/src/bower_components/emby-apiclient/sync/serversync.js @@ -12,11 +12,7 @@ define([], function() { } function uploadContent(connectionManager, server, options) { - return new Promise(function(resolve, reject) { - require(["contentuploader"], function(ContentUploader) { - (new ContentUploader).uploadImages(connectionManager, server).then(resolve, reject) - }) - }) + return new Promise().resolve(); } function syncMedia(connectionManager, server, options) { diff --git a/src/scripts/site.js b/src/scripts/site.js index af92dfe8e2..7346c079b6 100644 --- a/src/scripts/site.js +++ b/src/scripts/site.js @@ -304,8 +304,8 @@ var Dashboard = { var embyWebComponentsBowerPath = bowerPath + "/emby-webcomponents"; "android" === self.appMode - ? (define("filesystem", ["cordova/filesystem"], returnFirstDependency), define("cameraRoll", ["cordova/cameraroll"], returnFirstDependency)) - : (define("filesystem", [embyWebComponentsBowerPath + "/filesystem"], returnFirstDependency), define("cameraRoll", [apiClientBowerPath + "/cameraroll"], returnFirstDependency)); + ? define("filesystem", ["cordova/filesystem"], returnFirstDependency) + : define("filesystem", [embyWebComponentsBowerPath + "/filesystem"], returnFirstDependency); window.IntersectionObserver && !browser.edge ? define("lazyLoader", [embyWebComponentsBowerPath + "/lazyloader/lazyloader-intersectionobserver"], returnFirstDependency) : define("lazyLoader", [embyWebComponentsBowerPath + "/lazyloader/lazyloader-scroll"], returnFirstDependency); @@ -1133,7 +1133,6 @@ var Dashboard = { ? define("fileupload", ["cordova/fileupload"], returnFirstDependency) : define("fileupload", [apiClientBowerPath + "/fileupload"], returnFirstDependency); define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]); - define("contentuploader", [apiClientBowerPath + "/sync/contentuploader"], returnFirstDependency); define("serversync", [apiClientBowerPath + "/sync/serversync"], returnFirstDependency); define("multiserversync", [apiClientBowerPath + "/sync/multiserversync"], returnFirstDependency); define("mediasync", [apiClientBowerPath + "/sync/mediasync"], returnFirstDependency);