File tree 2 files changed +12
-16
lines changed
apps/graphql-api/src/shared
2 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,11 @@ export class OneThreeThreeSevenXSearchAdapater extends SearchAdapter {
23
23
'SeekNDstroy' ,
24
24
'Cristie' ,
25
25
'mazemaze16' ,
26
- 'TeamRocker'
26
+ 'TeamRocker' ,
27
+ 'YIFY' ,
28
+ 'PMEDIA' ,
29
+ 'bone111' ,
30
+ 'Silmarillion'
27
31
]
28
32
/**
29
33
* Search for a episode
@@ -39,13 +43,13 @@ export class OneThreeThreeSevenXSearchAdapater extends SearchAdapter {
39
43
category : 'TV'
40
44
} )
41
45
46
+ // Get all the torrents from trusted uploaders and validate if the
47
+ // season and episode format is in the torrent
42
48
const foundTorrents = torrents . filter ( ( torrent ) =>
43
49
this . trustedUploaders . includes ( torrent . uploader ) &&
44
50
torrent . title . toUpperCase ( ) . includes ( this . buildSeasonEpisodeString ( episode ) . toUpperCase ( ) )
45
51
)
46
52
47
- console . log ( torrents )
48
-
49
53
const results = await Promise . all (
50
54
foundTorrents . map ( ( torrent ) => this . formatTorrent ( torrent , domain ) )
51
55
)
Original file line number Diff line number Diff line change @@ -365,10 +365,7 @@ export class TorrentService {
365
365
this . removeFromTorrents ( download , true )
366
366
367
367
let searchedSubs = false
368
- let lastUpdate = {
369
- progress : null ,
370
- numPeers : null
371
- }
368
+ let lastUpdate = null
372
369
373
370
// Keep track if we updated the episode of movie with the new status
374
371
let updatedItem = false
@@ -429,17 +426,12 @@ export class TorrentService {
429
426
this . subtitlesService . searchForSubtitles ( download , file )
430
427
}
431
428
432
- // Only update every 0.5 %
433
- if ( lastUpdate . progress === null
434
- || ( lastUpdate . progress + 0.5 ) < newProgress
435
- || lastUpdate . numPeers !== torrent . numPeers
436
- ) {
429
+ const now = Date . now ( )
430
+ // Only update 0,5 seconds
431
+ if ( lastUpdate === null || ( lastUpdate + 5000 ) < now ) {
437
432
this . logger . debug ( `[${ download . _id } ]: Progress ${ newProgress . toFixed ( 1 ) } % at ${ formatKbToString ( torrent . downloadSpeed ) } ` )
438
433
439
- lastUpdate = {
440
- progress : newProgress ,
441
- numPeers : torrent . numPeers
442
- }
434
+ lastUpdate = now
443
435
444
436
// Don't update if we are already updating
445
437
if ( ! updatingModel ) {
You can’t perform that action at this time.
0 commit comments