mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
check if label query list is not empty efore appending label to query string
This commit is contained in:
parent
1b30662b71
commit
b5f8a07a7f
3 changed files with 10 additions and 4 deletions
|
|
@ -17,8 +17,8 @@ android {
|
|||
applicationId "app.omnivore.omnivore"
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
versionCode 28
|
||||
versionName "0.0.28"
|
||||
versionCode 29
|
||||
versionName "0.0.29"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ suspend fun DataService.librarySearch(cursor: String?, query: String): SavedItem
|
|||
db.savedItemLabelDao().insertAll(labels)
|
||||
db.savedItemAndSavedItemLabelCrossRefDao().insertAll(crossRefs)
|
||||
|
||||
Log.d("sync", "found ${searchResult.items.size} items with search api. Query: $query")
|
||||
|
||||
return SavedItemSyncResult(
|
||||
hasError = false,
|
||||
hasMoreItems = false,
|
||||
|
|
@ -93,6 +95,8 @@ suspend fun DataService.sync(since: String, cursor: String?, limit: Int = 20): S
|
|||
db.savedItemLabelDao().insertAll(labels)
|
||||
db.savedItemAndSavedItemLabelCrossRefDao().insertAll(crossRefs)
|
||||
|
||||
Log.d("sync", "found ${syncResult.items.size} items with sync api. Since: $since")
|
||||
|
||||
return SavedItemSyncResult(
|
||||
hasError = false,
|
||||
hasMoreItems = syncResult.hasMoreItems,
|
||||
|
|
|
|||
|
|
@ -333,8 +333,10 @@ class LibraryViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
activeLabelsLiveData.value?.let {
|
||||
query += " label:"
|
||||
query += it.joinToString { label -> label.name }
|
||||
if (it.isNotEmpty()) {
|
||||
query += " label:"
|
||||
query += it.joinToString { label -> label.name }
|
||||
}
|
||||
}
|
||||
|
||||
return query
|
||||
|
|
|
|||
Loading…
Reference in a new issue