@@ -234,7 +234,7 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
234
234
switch fileTypeMatch .Type {
235
235
case Video , ChapteredVideo :
236
236
237
- go func (in , folder , origFilename , unsorted string , origSize int64 , lrvSize int , bar * mpb.Bar ) {
237
+ go func (in , folder , origFilename , unsorted string , origSize int64 , lrvSize int , bar * mpb.Bar , mtime time. Time ) {
238
238
defer wg .Done ()
239
239
x := origFilename
240
240
filename := origFilename
@@ -249,7 +249,8 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
249
249
err := utils .DownloadFile (
250
250
filepath .Join (unsorted , origFilename ),
251
251
fmt .Sprintf ("http://%s:8080/videos/DCIM/%s/%s" , in , folder , origFilename ),
252
- bar )
252
+ bar ,
253
+ & mtime )
253
254
if err != nil {
254
255
bar .EwmaSetCurrent (origSize , 1 * time .Millisecond )
255
256
bar .EwmaIncrInt64 (origSize , 1 * time .Millisecond )
@@ -304,7 +305,8 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
304
305
err := utils .DownloadFile (
305
306
filepath .Join (unsorted , proxyVideoName ),
306
307
fmt .Sprintf ("http://%s:8080/videos/DCIM/%s/%s" , in , folder , proxyVideoName ),
307
- proxyVideoBar )
308
+ proxyVideoBar ,
309
+ & mtime )
308
310
if err != nil {
309
311
proxyVideoBar .EwmaSetCurrent (int64 (lrvSize ), 1 * time .Millisecond )
310
312
proxyVideoBar .EwmaIncrInt64 (int64 (lrvSize ), 1 * time .Millisecond )
@@ -323,7 +325,7 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
323
325
}
324
326
inlineCounter .SetSuccess ()
325
327
}
326
- }(params .Input , folder .D , goprofile .N , unsorted , goprofile .S , goprofile .Glrv , bar )
328
+ }(params .Input , folder .D , goprofile .N , unsorted , goprofile .S , goprofile .Glrv , bar , tm )
327
329
328
330
case Photo :
329
331
type photo struct {
@@ -363,13 +365,14 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
363
365
}
364
366
365
367
for _ , item := range totalPhotos {
366
- go func (in string , nowPhoto photo , unsorted string ) {
368
+ go func (in string , nowPhoto photo , unsorted string , mtime time. Time ) {
367
369
defer wg .Done ()
368
370
369
371
err := utils .DownloadFile (
370
372
filepath .Join (unsorted , nowPhoto .Name ),
371
373
fmt .Sprintf ("http://%s:8080/videos/DCIM/%s/%s" , in , nowPhoto .Folder , nowPhoto .Name ),
372
374
nowPhoto .Bar ,
375
+ & mtime ,
373
376
)
374
377
if err != nil {
375
378
nowPhoto .Bar .EwmaSetCurrent (int64 (nowPhoto .Size ), 1 * time .Millisecond )
@@ -396,7 +399,7 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
396
399
return
397
400
}
398
401
}
399
- }(params .Input , item , unsorted )
402
+ }(params .Input , item , unsorted , tm )
400
403
}
401
404
402
405
case Multishot :
@@ -415,13 +418,14 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
415
418
}
416
419
multiShotBar := utils .GetNewBar (progressBar , gpFileInfo .S , filename , utils .IoTX )
417
420
418
- go func (in , folder , origFilename , unsorted string , origSize int64 ) {
421
+ go func (in , folder , origFilename , unsorted string , origSize int64 , mtime time. Time ) {
419
422
defer wg .Done ()
420
423
421
424
err := utils .DownloadFile (
422
425
filepath .Join (unsorted , origFilename ),
423
426
fmt .Sprintf ("http://%s:8080/videos/DCIM/%s/%s" , in , folder , origFilename ),
424
427
multiShotBar ,
428
+ & mtime ,
425
429
)
426
430
if err != nil {
427
431
bar .EwmaSetCurrent (origSize , 1 * time .Millisecond )
@@ -442,7 +446,7 @@ func ImportConnect(params utils.ImportParams) (*utils.Result, error) {
442
446
return
443
447
}
444
448
}
445
- }(params .Input , folder .D , filename , unsorted , gpFileInfo .S )
449
+ }(params .Input , folder .D , filename , unsorted , gpFileInfo .S , tm )
446
450
}
447
451
448
452
default :
0 commit comments