|
|
|
@ -7,7 +7,7 @@ use actix_multipart::Multipart;
|
|
|
|
|
use chrono::Utc;
|
|
|
|
|
use futures_util::StreamExt;
|
|
|
|
|
use harsh::Harsh;
|
|
|
|
|
use serde_json::{Map, Value, to_string_pretty};
|
|
|
|
|
use serde_json::{to_string_pretty, Map, Value};
|
|
|
|
|
|
|
|
|
|
use crate::{client, Client};
|
|
|
|
|
|
|
|
|
@ -101,9 +101,7 @@ impl WotLog {
|
|
|
|
|
}
|
|
|
|
|
Client::TinTin => (),
|
|
|
|
|
Client::ZMud => (),
|
|
|
|
|
Client::None => {
|
|
|
|
|
return Err("no client specified".into())
|
|
|
|
|
}
|
|
|
|
|
Client::None => return Err("no client specified".into()),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
self.json = map.into();
|
|
|
|
@ -119,7 +117,8 @@ impl WotLog {
|
|
|
|
|
std::fs::create_dir(&path)?;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let mut file = OpenOptions::new().write(true).create_new(true).open(&path.join(&self.id))?;
|
|
|
|
|
let mut file =
|
|
|
|
|
OpenOptions::new().write(true).create_new(true).open(&path.join(&self.id))?;
|
|
|
|
|
file.write_all(to_string_pretty(&self.json)?.as_bytes())?;
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|