mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
update file via remote id
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
b0a3fba221
commit
d0e99aeb2d
2 changed files with 14 additions and 2 deletions
|
@ -141,6 +141,17 @@ public class FileDataStorageManager {
|
|||
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));
|
||||
}
|
||||
|
|
|
@ -1521,8 +1521,9 @@ public class FileDisplayActivity extends HookActivity
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue