Add fix me

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-04-03 16:56:09 +02:00
parent b0fee010fa
commit 8e36d951ca
No known key found for this signature in database
GPG Key ID: 4E577DC593B59BDF
3 changed files with 26 additions and 0 deletions

View File

@ -1105,6 +1105,18 @@ public class FileDataStorageManager {
return share;
}
public OCShare getShareByShareLink(String shareLink) {
OCShare share = null;
Cursor cursor = getShareCursorForValue(ProviderTableMeta.OCSHARES_SHARE_LINK, shareLink);
if (cursor != null) {
if (cursor.moveToFirst()) {
share = createShareInstance(cursor);
}
cursor.close();
}
return share;
}
/**
* Checks the existence of an stored {@link OCShare} matching the given remote id (not to be confused with the local

View File

@ -2389,9 +2389,22 @@ public class FileDisplayActivity extends FileActivity
Log_OC.d(TAG, "ShareLink is: " + shareLink);
// FIXME share is nul
OCShare share = storageManager.getShareByShareLink(shareLink);
OCFile file = storageManager.getFileByDecryptedRemotePath(share.getPath());
if (file != null) {
setFile(file);
showFile(file, "");
} else {
showFile(null, getString(R.string.file_not_found));
}
/*
// FIXME Nextcloud not configured.
FetchRemoteFileTask fetchRemoteFileTask = new FetchRemoteFileTask(user, shareLink, storageManager, this);
fetchRemoteFileTask.execute();
*/
}
private void openFileByPath(User user, String filepath) {

View File

@ -41,6 +41,7 @@ public class FetchRemoteFileTask extends AsyncTask<Void, Void, String> {
this.fileDisplayActivity = fileDisplayActivity;
}
// FIXME Nextcloud not configured.
@Override
protected String doInBackground(Void... voids) {
SearchRemoteOperation searchRemoteOperation = new SearchRemoteOperation(fileId,