|
|
|
@ -223,11 +223,20 @@ pub(super) async fn get_cards_images( |
|
|
|
.and_then(|x| { |
|
|
|
p.as_ref() |
|
|
|
.metadata() |
|
|
|
.and_then(|x| x.modified()) |
|
|
|
.map_err(|e| { |
|
|
|
log::error!("MetadataError: {}", e); |
|
|
|
e |
|
|
|
}) |
|
|
|
.and_then(|x| { |
|
|
|
x.modified().map_err(|e| { |
|
|
|
log::error!("ModifiedError: {}", e); |
|
|
|
e |
|
|
|
}) |
|
|
|
}) |
|
|
|
.ok() |
|
|
|
.map(|y| (y.into(), x.into())) |
|
|
|
}) |
|
|
|
.map_or(false, |(x, y): (EpochTime, EpochTime)| x > y) |
|
|
|
.map_or(true, |(x, y): (EpochTime, EpochTime)| x > y) |
|
|
|
} |
|
|
|
|
|
|
|
if is_newer(&card_kind, &face) { |
|
|
|
@ -261,8 +270,18 @@ pub(super) async fn get_cards_images( |
|
|
|
.unwrap(); |
|
|
|
} |
|
|
|
} |
|
|
|
// log::info!(
|
|
|
|
// "Loading {} (face: {}, back: {})",
|
|
|
|
// card_kind.kind,
|
|
|
|
// is_newer(&card_kind, &face),
|
|
|
|
// is_newer(&card_kind, &back)
|
|
|
|
// )
|
|
|
|
} |
|
|
|
let mut b = Bytes::from(ar.into_inner().unwrap().finish().into_result().unwrap()); |
|
|
|
log::info!( |
|
|
|
"Compressed tar size: {}", |
|
|
|
crate::allocator::as_string(b.len()) |
|
|
|
); |
|
|
|
let n = (b.len() / MESSAGE_SIZE) + if b.len() % MESSAGE_SIZE == 0 { 0 } else { 1 }; |
|
|
|
socket_mgr |
|
|
|
.write( |
|
|
|
|