Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ public OCFile getFileByLocalPath(String path) {
return file;
}

public @Nullable
OCFile getFileByRemoteId(String remoteId) {
Cursor c = getFileCursorForValue(ProviderTableMeta.FILE_REMOTE_ID, remoteId);
OCFile file = null;
if (c.moveToFirst()) {
file = createFileInstance(c);
}
c.close();
return file;
}

public boolean fileExists(long id) {
return fileExists(ProviderTableMeta._ID, String.valueOf(id));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1489,8 +1489,9 @@ public void onReceive(Context context, Intent intent) {
}

if (mWaitingToSend != null) {
mWaitingToSend = getStorageManager().getFileByPath(mWaitingToSend.getRemotePath());
if (mWaitingToSend.isDown() && downloadBehaviour != null) {
// update file after downloading
mWaitingToSend = getStorageManager().getFileByRemoteId(mWaitingToSend.getRemoteId());
if (mWaitingToSend != null && mWaitingToSend.isDown() && downloadBehaviour != null) {
switch (downloadBehaviour) {
case OCFileListFragment.DOWNLOAD_SEND:
String packageName = intent.getStringExtra(SendShareDialog.PACKAGE_NAME);
Expand Down