Migrate file search settings to decentralized json data store

This commit is contained in:
MM20
2023-11-25 18:54:27 +01:00
parent 25cd9b707e
commit 966d43d4d1
11 changed files with 244 additions and 96 deletions
@@ -41,13 +41,6 @@ interface SearchService {
calendars: CalendarSearchSettings = Settings.CalendarSearchSettings.newBuilder()
.setEnabled(false)
.build(),
files: FilesSearchSettings = Settings.FilesSearchSettings.newBuilder()
.setLocalFiles(false)
.setGdrive(false)
.setOnedrive(false)
.setOwncloud(false)
.setNextcloud(false)
.build(),
calculator: CalculatorSearchSettings = Settings.CalculatorSearchSettings.newBuilder()
.setEnabled(false)
.build(),
@@ -82,7 +75,6 @@ internal class SearchServiceImpl(
shortcuts: AppShortcutSearchSettings,
contacts: ContactsSearchSettings,
calendars: CalendarSearchSettings,
files: FilesSearchSettings,
calculator: CalculatorSearchSettings,
unitConverter: UnitConverterSearchSettings,
websites: WebsiteSearchSettings,
@@ -184,18 +176,16 @@ internal class SearchServiceImpl(
}
}
}
if (files.localFiles || files.owncloud || files.onedrive || files.gdrive || files.nextcloud) {
launch {
fileRepository.search(
query,
)
.withCustomLabels(customAttributesRepository)
.collectLatest { r ->
results.update {
it.copy(files = r.toImmutableList())
}
launch {
fileRepository.search(
query,
)
.withCustomLabels(customAttributesRepository)
.collectLatest { r ->
results.update {
it.copy(files = r.toImmutableList())
}
}
}
}
launch {
customAttributesRepository.search(query)