File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -495,6 +495,12 @@ func (k *KedgeDownloadStatus) Percentage() float32 {
495495}
496496
497497func (k * KedgeDownloadStatus ) ETA () * time.Duration {
498+ if k .kedgeListener .IsSeeding {
499+ if k .CompletedLength () >= k .TotalLength () {
500+ dur := time .Now ().Sub (k .kedgeListener .SeedStartTime )
501+ return & dur
502+ }
503+ }
498504 dur := utils .CalculateETA (k .TotalLength ()- k .CompletedLength (), k .Speed ())
499505 return & dur
500506}
Original file line number Diff line number Diff line change @@ -101,7 +101,13 @@ func PrepareMirror(opts *PrepareMirrorOptions) error {
101101
102102 link = utils .ParseMessageArgs (opts .Message .Text )
103103 engine .L ().Info (link )
104- fileId := utils .GetFileIdByGDriveLink (opts .Message .Text )
104+ newLink , err := extract (link , opts .B , opts .Ctx )
105+ if err != nil {
106+ engine .L ().Infof ("Failed to extract ddl even: %v" , err )
107+ } else {
108+ link = newLink
109+ }
110+ fileId := utils .GetFileIdByGDriveLink (link )
105111 if fileId != "" {
106112 engine .NewGDriveDownloadTransferService (fileId , & listener )
107113 defer func () {
@@ -125,13 +131,6 @@ func PrepareMirror(opts *PrepareMirrorOptions) error {
125131 engine .SendMessage (opts .B , "No source provided" , opts .Message )
126132 return nil
127133 }
128- newLink , err := extract (link , opts .B , opts .Ctx )
129- if err != nil {
130- engine .L ().Infof ("Failed to extract ddl even: %v" , err )
131- } else {
132- link = newLink
133- fileId = utils .GetFileIdByGDriveLink (link )
134- }
135134 isTorrent , _ = utils .IsTorrentLink (link )
136135
137136 if utils .IsMagnetLink (link ) || isTorrent {
You can’t perform that action at this time.
0 commit comments