File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,24 @@ module.exports = async ({
339
339
if ( rows . length === 0 && isSHA1 && ! isP2P ) // trying to get via dht
340
340
{
341
341
logT ( 'search' , 'get torrent via infohash with dht' )
342
+ // double check torrent magnet
343
+ let secondTry = false ;
344
+ const doubleCheckTimeout = setTimeout ( ( ) => {
345
+ secondTry = true ;
346
+ logT ( 'search' , 'second try search by dht' )
347
+ torrentClient . getMetadata ( text , ( torrent ) => {
348
+ logT ( 'search' , 'dht search found something' )
349
+ searchList . push ( baseRowData ( torrent ) ) ;
350
+ callback ( searchList ) ;
351
+ } )
352
+ } , 8000 )
342
353
torrentClient . getMetadata ( text , ( torrent ) => {
354
+ clearTimeout ( doubleCheckTimeout ) ;
355
+ if ( secondTry ) {
356
+ logT ( 'search' , 'ignore search dht resopond because of second try' )
357
+ return
358
+ }
359
+ logT ( 'search' , 'dht search found something' )
343
360
searchList . push ( baseRowData ( torrent ) ) ;
344
361
callback ( searchList ) ;
345
362
} )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ describe("download", function() {
44
44
let progress = parseInt ( await ( await app . client . $ ( '.torrentRow .progressDownloading' ) ) . getText ( ) ) ;
45
45
console . log ( 'download progress' , progress , '%' ) ;
46
46
// cancel in progress button must be exists
47
- if ( progress < 90 ) {
47
+ if ( progress < 50 ) {
48
48
console . log ( 'testing buttons' )
49
49
assert ( await ( await app . client . $ ( '.torrentRow .deleteDownloadBeforeFinish' ) ) . isExisting ( ) ) ;
50
50
assert ( await ( await app . client . $ ( '.torrentRow .pauseTorrent' ) ) . isExisting ( ) ) ;
You can’t perform that action at this time.
0 commit comments