downloadResult = mCurrentDownload.execute(mDownloadClient);
if (downloadResult.isSuccess()) {
saveDownloadedFile();
+ } else {
+ updateUnsuccessfulDownloadedFile();
}
} catch (AccountsException e) {
mStorageManager.triggerMediaScan(file.getStoragePath());
}
+ /**
+ * Update the OC File after a unsuccessful download
+ */
+ private void updateUnsuccessfulDownloadedFile() {
+ OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId());
+ file.setDownloading(false);
+ mStorageManager.saveFile(file);
+ }
+
/**
* Creates a status notification to show the download progress