mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
add downloader
This commit is contained in:
1 parent
811dd73e13
commit
5380742513
11 files changed
+403
-94
No files matched your search
@@ -339,7 +339,7 @@ impl YomitanWriter {
|
||||
if let Some(row) = rows.next()? {
|
||||
let is_outdated: bool = row.get(0)?;
|
||||
if is_outdated {
|
||||
self.drop_dictionary(title)?;
|
||||
self.drop_dictionary(bundle_name, lang)?;
|
||||
} else {
|
||||
return Ok(YomitanZipImportResult {
|
||||
exists: true,
|
||||
@@ -608,9 +608,11 @@ impl YomitanWriter {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn drop_dictionary(&self, title: &str) -> Result<()> {
|
||||
self.conn
|
||||
.execute("DELETE FROM dictionaries WHERE title = ?1", [title])?;
|
||||
pub fn drop_dictionary(&self, bundle_name: &str, lang: &str) -> Result<()> {
|
||||
self.conn.execute(
|
||||
"DELETE FROM dictionaries WHERE bundle_name = ?1 AND lang = ?2",
|
||||
[bundle_name, lang],
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user