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

update image editor

This commit is contained in:
Luke Pulverenti 2015-09-17 17:26:06 -04:00
parent c5bfd529a2
commit c64aedc131
6 changed files with 64 additions and 24 deletions

View file

@ -467,13 +467,37 @@
var deferred = DeferredBuilder.Deferred();
Logger.log('downloading: ' + url + ' to ' + localPath);
var ft = new FileTransfer();
ft.download(url, localPath, function (entry) {
var localUrl = normalizeReturnUrl(entry.toURL());
getFileSystem().done(function (fileSystem) {
fileSystem.root.getFile(localPath.replace('file://', ''), {}, function (targetFile) {
var downloader = new BackgroundTransfer.BackgroundDownloader();
// Create a new download operation.
var download = downloader.createDownload(url, targetFile);
// Start the download and persist the promise to be able to cancel the download.
app.downloadPromise = download.startAsync().then(function () {
// on success
var localUrl = normalizeReturnUrl(targetFile.toURL());
Logger.log('Downloaded local url: ' + localUrl);
deferred.resolveWith(null, [localUrl]);
}, function () {
// on error
Logger.log('download failed: ' + url + ' to ' + localPath);
deferred.reject();
}, function (value) {
// on progress
Logger.log('download progress: ' + value);
});
});
Logger.log('Downloaded local url: ' + localUrl);
deferred.resolveWith(null, [localUrl]);
});
return deferred.promise();
@ -537,7 +561,7 @@
}
function getLocalId(serverId, itemId) {
return serverId + '_' + itemId;
}
function hasImage(serverId, itemId, imageTag) {