mirror of
https://github.com/flibusta-apps/library_updater.git
synced 2025-12-06 15:45:36 +01:00
Optimize
This commit is contained in:
@@ -127,7 +127,7 @@ impl FromVecExpression<Book> for Book {
|
|||||||
},
|
},
|
||||||
uploaded: match &value[2] {
|
uploaded: match &value[2] {
|
||||||
sql_parse::Expression::String(v) => {
|
sql_parse::Expression::String(v) => {
|
||||||
NaiveDateTime::parse_from_str(&v.value.to_string(), "%Y-%m-%d %H:%M:%S")
|
NaiveDateTime::parse_from_str(&v.value, "%Y-%m-%d %H:%M:%S")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.date()
|
.date()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ async fn process<T>(
|
|||||||
where
|
where
|
||||||
T: Debug + FromVecExpression<T> + Update,
|
T: Debug + FromVecExpression<T> + Update,
|
||||||
{
|
{
|
||||||
if deps.len() != 0 {
|
if !deps.is_empty() {
|
||||||
loop {
|
loop {
|
||||||
let mut some_failed = false;
|
let mut some_failed = false;
|
||||||
let mut some_none = false;
|
let mut some_none = false;
|
||||||
@@ -155,7 +155,7 @@ where
|
|||||||
match value.update(&client, source_id).await {
|
match value.update(&client, source_id).await {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
// log::info!("{:?}", value);
|
// log::info!("{:?}", value);
|
||||||
()
|
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
log::error!("Update error: {:?} : {:?}", value, err);
|
log::error!("Update error: {:?} : {:?}", value, err);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub fn remove_wrong_chars(s: &str) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_lang(s: &str) -> String {
|
pub fn parse_lang(s: &str) -> String {
|
||||||
s.replace('-', "").replace('~', "").to_lowercase()
|
s.replace(['-', '~'], "").to_lowercase()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fix_annotation_text(text: &str) -> String {
|
pub fn fix_annotation_text(text: &str) -> String {
|
||||||
|
|||||||
Reference in New Issue
Block a user