File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export class ConfigService {
18
18
public static readonly DOWNLOAD_LOCATION : string = 'DOWNLOAD_LOCATION'
19
19
public static readonly OPENSUBTITLES_USERNAME : string = 'OPENSUBTITLES_USERNAME'
20
20
public static readonly OPENSUBTITLES_PASSWORD : string = 'OPENSUBTITLES_PASSWORD'
21
+ public static readonly MAX_CONCURRENT_DOWNLOADS : string = 'MAX_CONCURRENT_DOWNLOADS'
21
22
public static readonly TRAKT_KEY : string = 'TRAKT_KEY'
22
23
23
24
private readonly envConfig : { [ key : string ] : string }
@@ -103,6 +104,8 @@ export class ConfigService {
103
104
[ ConfigService . OPENSUBTITLES_USERNAME ] : Joi . string ( ) ,
104
105
105
106
[ ConfigService . OPENSUBTITLES_PASSWORD ] : Joi . string ( )
107
+ [ ConfigService . MAX_CONCURRENT_DOWNLOADS ] : Joi . number ( )
108
+ . default ( 1 ) ,
106
109
} )
107
110
108
111
const { error, value : validatedEnvConfig } = envVarsSchema . validate ( envConfig , { stripUnknown : true } )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export class TorrentService {
30
30
/**
31
31
* Maximum of concurrent downloads in the background
32
32
*/
33
- private maxConcurrent = 1
33
+ private readonly maxConcurrent
34
34
35
35
/**
36
36
* Array of downloads that will be downloaded in the background
@@ -89,7 +89,7 @@ export class TorrentService {
89
89
private readonly configService : ConfigService ,
90
90
private readonly subtitlesService : SubtitlesService
91
91
) {
92
- this . setupWebTorrent ( )
92
+ this . maxConcurrent = this . configService . get ( ConfigService . MAX_CONCURRENT_DOWNLOADS )
93
93
94
94
// Check for incomplete downloads and add them to the downloads
95
95
this . checkForIncompleteDownloads ( )
You can’t perform that action at this time.
0 commit comments