mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update media sync
This commit is contained in:
parent
6ef418cf8d
commit
09c7da7d48
19 changed files with 138 additions and 95 deletions
|
@ -8,24 +8,16 @@
|
|||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
|
||||
var apiClient = connectionManager.getApiClient(server.Id);
|
||||
LocalAssetManager.getCameraPhotos().done(function (photos) {
|
||||
|
||||
apiClient.getContentUploadHistory().done(function (result) {
|
||||
if (!photos.length) {
|
||||
deferred.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
uploadImagesWithHistory(server, result, apiClient, deferred);
|
||||
var apiClient = connectionManager.getApiClient(server.Id);
|
||||
|
||||
}).fail(function () {
|
||||
deferred.reject();
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
};
|
||||
|
||||
function uploadImagesWithHistory(server, uploadHistory, apiClient, deferred) {
|
||||
|
||||
require(['localassetmanager', "cryptojs-sha1"], function () {
|
||||
|
||||
LocalAssetManager.getCameraPhotos().done(function (photos) {
|
||||
apiClient.getContentUploadHistory().done(function (uploadHistory) {
|
||||
|
||||
photos = getFilesToUpload(photos, uploadHistory);
|
||||
|
||||
|
@ -36,8 +28,13 @@
|
|||
}).fail(function () {
|
||||
deferred.reject();
|
||||
});
|
||||
|
||||
}).fail(function () {
|
||||
deferred.reject();
|
||||
});
|
||||
}
|
||||
|
||||
return deferred.promise();
|
||||
};
|
||||
|
||||
function getFilesToUpload(files, uploadHistory) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue