yomitan init on UI

This commit is contained in:
polv committed 2026-02-25 19:01:55 +07:00
1 parent 3b5afbc34e
commit ff64c035e6
8 files changed
+245 -46

No files matched your search

-13
View File
@@ -46,19 +46,6 @@ impl Database {
})
}
pub fn is_yomitan_dbfile_init(&self) -> Result<bool> {
let yomitan_db_path = self.dir.join(YOMITAN_DBFILE);
if yomitan_db_path.exists() {
return Ok(false);
}
let conn = Connection::open(yomitan_db_path)?;
let mut stmt = conn.prepare("SELECT 1 FROM dictionaries")?;
Ok(stmt.exists([])?)
}
pub fn yomitan(&self) -> Result<yomitan::YomitanDatabase> {
self.ensure_yomitan_attached()?;
Ok(yomitan::YomitanDatabase::new(self.clone()))