mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
show folders when receiving
This commit is contained in:
parent
c1edf24338
commit
9286b3c965
1 changed files with 10 additions and 0 deletions
|
@ -94,6 +94,7 @@ type Client struct {
|
||||||
CurrentFileChunkRanges []int64
|
CurrentFileChunkRanges []int64
|
||||||
CurrentFileChunks []int64
|
CurrentFileChunks []int64
|
||||||
CurrentFileIsClosed bool
|
CurrentFileIsClosed bool
|
||||||
|
LastFolder string
|
||||||
|
|
||||||
TotalSent int64
|
TotalSent int64
|
||||||
TotalChunksTransfered int
|
TotalChunksTransfered int
|
||||||
|
@ -1200,6 +1201,8 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error)
|
||||||
if len(c.FilesToTransfer) == 1 {
|
if len(c.FilesToTransfer) == 1 {
|
||||||
// description = c.FilesToTransfer[i].Name
|
// description = c.FilesToTransfer[i].Name
|
||||||
description = ""
|
description = ""
|
||||||
|
} else {
|
||||||
|
description = " " + description
|
||||||
}
|
}
|
||||||
c.bar = progressbar.NewOptions64(1,
|
c.bar = progressbar.NewOptions64(1,
|
||||||
progressbar.OptionOnCompletion(func() {
|
progressbar.OptionOnCompletion(func() {
|
||||||
|
@ -1265,6 +1268,11 @@ func (c *Client) updateIfRecipientHasFileInfo() (err error) {
|
||||||
finished = false
|
finished = false
|
||||||
c.FilesToTransferCurrentNum = i
|
c.FilesToTransferCurrentNum = i
|
||||||
c.numberOfTransferedFiles++
|
c.numberOfTransferedFiles++
|
||||||
|
newFolder, _ := filepath.Split(fileInfo.FolderRemote)
|
||||||
|
if newFolder != c.LastFolder && len(c.FilesToTransfer) > 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "\r%s\n", newFolder)
|
||||||
|
}
|
||||||
|
c.LastFolder = newFolder
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// TODO: print out something about this file already existing
|
// TODO: print out something about this file already existing
|
||||||
|
@ -1353,6 +1361,8 @@ func (c *Client) setBar() {
|
||||||
if len(c.FilesToTransfer) == 1 {
|
if len(c.FilesToTransfer) == 1 {
|
||||||
// description = c.FilesToTransfer[c.FilesToTransferCurrentNum].Name
|
// description = c.FilesToTransfer[c.FilesToTransferCurrentNum].Name
|
||||||
description = ""
|
description = ""
|
||||||
|
} else if !c.Options.IsSender {
|
||||||
|
description = " " + description
|
||||||
}
|
}
|
||||||
c.bar = progressbar.NewOptions64(
|
c.bar = progressbar.NewOptions64(
|
||||||
c.FilesToTransfer[c.FilesToTransferCurrentNum].Size,
|
c.FilesToTransfer[c.FilesToTransferCurrentNum].Size,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue