Merge branch 'develop' into feature/rebuild_share
This commit is contained in:
commit
5b403ea129
5 changed files with 10 additions and 20 deletions
1
notes.md
1
notes.md
|
|
@ -53,3 +53,4 @@
|
|||
- hashing
|
||||
- store file hashes with all `file::*` variants
|
||||
- check hashes on "continue"
|
||||
- CLI switch to skip hashing
|
||||
|
|
|
|||
|
|
@ -86,9 +86,8 @@ impl AppState {
|
|||
|
||||
bar.set_position(upl.get_offset());
|
||||
// BUG in `indicatif` crate?
|
||||
// `set_position` does not force an immediate redraw, so we also call `inc_length` here
|
||||
// `set_position` does not force an immediate redraw, so we need to call `set_length` after
|
||||
bar.set_length(upl.get_size());
|
||||
// bar.inc_length(0);
|
||||
|
||||
f(bar);
|
||||
|
||||
|
|
@ -163,13 +162,10 @@ impl AppState {
|
|||
self.http
|
||||
.share_create(&args.get_uri(), &args.alias, args.get_share_request())?;
|
||||
|
||||
self.with_progressbar(true, ProgressBar::abandon);
|
||||
Ok(Self::new(self.http, CacheFile::from_args(args, share_id)))
|
||||
}
|
||||
|
||||
pub fn file_names(&self) -> Vec<&str> {
|
||||
self.inner.file_names()
|
||||
}
|
||||
|
||||
pub fn save(&self) -> io::Result<()> {
|
||||
self.inner.save()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use crate::{
|
||||
cli::Cli,
|
||||
file::{self, Chunk, FileTrait},
|
||||
file::{self, Chunk},
|
||||
sharry::{self, Client, Uri},
|
||||
};
|
||||
|
||||
|
|
@ -67,17 +67,6 @@ impl CacheFile {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn file_names(&self) -> Vec<&str> {
|
||||
let mut result = vec![];
|
||||
|
||||
if let Some(upl) = self.uploading.as_ref() {
|
||||
result.push(upl.get_name());
|
||||
}
|
||||
self.files.iter().map(|chk| result.push(chk.get_name()));
|
||||
|
||||
result
|
||||
}
|
||||
|
||||
pub fn queue_empty(&self) -> bool {
|
||||
self.files.is_empty()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use clap::{
|
|||
use log::LevelFilter;
|
||||
|
||||
use crate::{
|
||||
file::Checked,
|
||||
file::{Checked, FileTrait},
|
||||
sharry::{NewShareRequest, Uri},
|
||||
};
|
||||
|
||||
|
|
@ -130,6 +130,10 @@ impl Cli {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn file_names(&self) -> Vec<&str> {
|
||||
self.files.iter().map(FileTrait::get_name).collect()
|
||||
}
|
||||
|
||||
pub fn get_hash(&self) -> String {
|
||||
let file_refs = {
|
||||
let mut refs: Vec<_> = self.files.iter().collect();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ fn main() {
|
|||
|
||||
info!("continuing with state: {state:#?}");
|
||||
|
||||
let fns_magenta = output::style_all(&state.file_names(), |s| style(s).magenta()).join(", ");
|
||||
let fns_magenta = output::style_all(&args.file_names(), |s| style(s).magenta()).join(", ");
|
||||
|
||||
println!("{} is uploading: {fns_magenta}", *SHRUPL);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue