mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
add delete dict operations
This commit is contained in:
1 parent
fa5bfb56b0
commit
1e91f21ca4
8 files changed
+129
-44
No files matched your search
@@ -43,7 +43,7 @@ impl AppService {
|
||||
|
||||
pub fn get_yomitan_writer(&self) -> Result<YomitanWriter, CJDicError> {
|
||||
let conn = Connection::open(self.db.dir.join("yomitan.db"))?;
|
||||
let writer = YomitanWriter::new(conn);
|
||||
let writer = YomitanWriter::new(conn)?;
|
||||
writer.create_schema()?;
|
||||
Ok(writer)
|
||||
}
|
||||
@@ -53,6 +53,13 @@ impl AppService {
|
||||
zip_file: PathBuf,
|
||||
lang: &str,
|
||||
) -> Result<YomitanZipImportResult, CJDicError> {
|
||||
Ok(writer.import_bundled_zip_file(zip_file, lang)?)
|
||||
Ok(writer.import_dictionary_zip_file(zip_file, lang)?)
|
||||
}
|
||||
|
||||
pub fn remove_yomitan_dictionary(
|
||||
writer: &mut YomitanWriter,
|
||||
title: &str,
|
||||
) -> Result<(), CJDicError> {
|
||||
Ok(writer.drop_dictionary(title)?)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user