parent
94bd84b45d
commit
0df46a63ec
|
@ -725,7 +725,12 @@ impl<'de> Deserialize<'de> for SearchBackend {
|
|||
let s = <String>::deserialize(deserializer)?;
|
||||
match s.as_str() {
|
||||
#[cfg(feature = "sqlite3")]
|
||||
sqlite3 if sqlite3.eq_ignore_ascii_case("sqlite3") => Ok(SearchBackend::Sqlite3),
|
||||
sqlite3
|
||||
if sqlite3.eq_ignore_ascii_case("sqlite3")
|
||||
|| sqlite3.eq_ignore_ascii_case("sqlite") =>
|
||||
{
|
||||
Ok(SearchBackend::Sqlite3)
|
||||
}
|
||||
none if none.eq_ignore_ascii_case("none")
|
||||
|| none.eq_ignore_ascii_case("nothing")
|
||||
|| none.is_empty() =>
|
||||
|
|
|
@ -489,6 +489,31 @@ impl Account {
|
|||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "sqlite3")]
|
||||
if settings.conf.search_backend == crate::conf::SearchBackend::Sqlite3 {
|
||||
let db_path = match crate::sqlite3::db_path() {
|
||||
Err(err) => {
|
||||
sender
|
||||
.send(ThreadEvent::UIEvent(UIEvent::StatusEvent(
|
||||
StatusEvent::DisplayMessage(format!("Error with setting up an sqlite3 search database for account `{}`: {}", name, err))
|
||||
)))
|
||||
.unwrap();
|
||||
None
|
||||
}
|
||||
Ok(path) => Some(path),
|
||||
};
|
||||
if let Some(db_path) = db_path {
|
||||
if !db_path.exists() {
|
||||
sender
|
||||
.send(ThreadEvent::UIEvent(UIEvent::StatusEvent(
|
||||
StatusEvent::DisplayMessage(format!("An sqlite3 search database for account `{}` seems to be missing, a new one must be created with the `reindex` command.", name))
|
||||
)))
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Account {
|
||||
hash,
|
||||
name,
|
||||
|
|
Loading…
Reference in New Issue