mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 05:35:39 +03:00
Merge pull request #9175 from nextcloud/fix/url-parse-search-result
Unified search: skip local file check for non-file results
This commit is contained in:
commit
35a2324482
2 changed files with 5 additions and 7 deletions
|
@ -59,12 +59,10 @@ class UnifiedSearchItemViewHolder(
|
||||||
binding.title.text = entry.title
|
binding.title.text = entry.title
|
||||||
binding.subline.text = entry.subline
|
binding.subline.text = entry.subline
|
||||||
|
|
||||||
storageManager.getFileByDecryptedRemotePath(entry.remotePath())?.let {
|
if (entry.isFile && storageManager.getFileByDecryptedRemotePath(entry.remotePath()) != null) {
|
||||||
if (it.isDown) {
|
binding.localFileIndicator.visibility = View.VISIBLE
|
||||||
binding.localFileIndicator.visibility = View.VISIBLE
|
} else {
|
||||||
} else {
|
binding.localFileIndicator.visibility = View.GONE
|
||||||
binding.localFileIndicator.visibility = View.GONE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val mimetype = MimeTypeUtil.getBestMimeTypeByFilename(entry.title)
|
val mimetype = MimeTypeUtil.getBestMimeTypeByFilename(entry.title)
|
||||||
|
|
|
@ -144,7 +144,7 @@ class UnifiedSearchViewModel(application: Application) : AndroidViewModel(applic
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun openResult(result: SearchResultEntry) {
|
override fun openResult(result: SearchResultEntry) {
|
||||||
if (result.fileId() != null) {
|
if (result.isFile) {
|
||||||
openFile(result.remotePath())
|
openFile(result.remotePath())
|
||||||
} else {
|
} else {
|
||||||
val uri = Uri.parse(result.resourceUrl)
|
val uri = Uri.parse(result.resourceUrl)
|
||||||
|
|
Loading…
Reference in a new issue