mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
92d17ee6b6
commit
53a694a8f5
2 changed files with 22 additions and 2 deletions
|
|
@ -183,6 +183,16 @@ impl FileOutLink {
|
||||||
task.log(reason);
|
task.log(reason);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if let TaskProg::FileCut(prog) = &mut task.prog {
|
||||||
|
match self {
|
||||||
|
Self::Succ => {
|
||||||
|
prog.success_files += 1;
|
||||||
|
}
|
||||||
|
Self::Fail(reason) => {
|
||||||
|
prog.failed_files += 1;
|
||||||
|
task.log(reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ trait Traverse {
|
||||||
|
|
||||||
fn from(&self) -> Url<'_>;
|
fn from(&self) -> Url<'_>;
|
||||||
|
|
||||||
async fn get_or_init_cha(&mut self) -> io::Result<Cha> {
|
async fn init(&mut self) -> io::Result<Cha> {
|
||||||
if self.cha().is_none() {
|
if self.cha().is_none() {
|
||||||
*self.cha() = Some(super::File::cha(self.from(), self.follow(), None).await?)
|
*self.cha() = Some(super::File::cha(self.from(), self.follow(), None).await?)
|
||||||
}
|
}
|
||||||
|
|
@ -116,6 +116,16 @@ impl Traverse for FileInUpload {
|
||||||
|
|
||||||
fn from(&self) -> Url<'_> { self.url.as_url() }
|
fn from(&self) -> Url<'_> { self.url.as_url() }
|
||||||
|
|
||||||
|
async fn init(&mut self) -> io::Result<Cha> {
|
||||||
|
if self.cha.is_none() {
|
||||||
|
self.cha = Some(super::File::cha(self.from(), self.follow(), None).await?)
|
||||||
|
}
|
||||||
|
if self.cache.is_none() {
|
||||||
|
self.cache = self.url.cache();
|
||||||
|
}
|
||||||
|
Ok(self.cha.unwrap())
|
||||||
|
}
|
||||||
|
|
||||||
fn spawn(&self, from: UrlBuf, _to: Option<UrlBuf>, cha: Cha) -> Self {
|
fn spawn(&self, from: UrlBuf, _to: Option<UrlBuf>, cha: Cha) -> Self {
|
||||||
Self { id: self.id, cha: Some(cha), cache: from.cache(), url: from }
|
Self { id: self.id, cha: Some(cha), cache: from.cache(), url: from }
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +148,7 @@ where
|
||||||
FR: Future<Output = Result<(), R>>,
|
FR: Future<Output = Result<(), R>>,
|
||||||
E: Fn(String),
|
E: Fn(String),
|
||||||
{
|
{
|
||||||
let cha = task.get_or_init_cha().await?;
|
let cha = task.init().await?;
|
||||||
if !cha.is_dir() {
|
if !cha.is_dir() {
|
||||||
return on_file(task, cha).await;
|
return on_file(task, cha).await;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue