mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +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;
|
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) {
|
public boolean fileExists(long id) {
|
||||||
return fileExists(ProviderTableMeta._ID, String.valueOf(id));
|
return fileExists(ProviderTableMeta._ID, String.valueOf(id));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1521,8 +1521,9 @@ public class FileDisplayActivity extends HookActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mWaitingToSend != null) {
|
if (mWaitingToSend != null) {
|
||||||
mWaitingToSend = getStorageManager().getFileByPath(mWaitingToSend.getRemotePath());
|
// update file after downloading
|
||||||
if (mWaitingToSend.isDown() && downloadBehaviour != null) {
|
mWaitingToSend = getStorageManager().getFileByRemoteId(mWaitingToSend.getRemoteId());
|
||||||
|
if (mWaitingToSend != null && mWaitingToSend.isDown() && downloadBehaviour != null) {
|
||||||
switch (downloadBehaviour) {
|
switch (downloadBehaviour) {
|
||||||
case OCFileListFragment.DOWNLOAD_SEND:
|
case OCFileListFragment.DOWNLOAD_SEND:
|
||||||
String packageName = intent.getStringExtra(SendShareDialog.PACKAGE_NAME);
|
String packageName = intent.getStringExtra(SendShareDialog.PACKAGE_NAME);
|
||||||
|
|
Loading…
Reference in a new issue