@@ -18,26 +18,28 @@ public class MServerConfigDTO extends MServerBasicConfigDTO implements ConfigDTO
18
18
private final String ignoreFilmlistPath ;
19
19
/** add livestreams from external list **/
20
20
private final ImportLivestreamConfiguration importLivestreamConfiguration ;
21
+ /** add additional filmlist from external **/
22
+ private final List <ImportFilmlistConfiguration > importFilmlistConfigurations ;
21
23
/** The maximum amount of cpu threads to be used. */
22
24
private Integer maximumCpuThreads ;
23
25
/**
24
26
* The maximum duration in minutes the server should run.<br>
25
27
* If set to 0 the server runs without a time limit.
26
28
*/
27
29
private Integer maximumServerDurationInMinutes ;
28
-
30
+ private Long checkImportListUrlMinSize ;
31
+ private Long checkImportListUrlTimeoutInSec ;
32
+
29
33
private Map <Sender , MServerBasicConfigDTO > senderConfigurations ;
30
34
private Set <Sender > senderExcluded ;
31
35
private Set <Sender > senderIncluded ;
32
36
private Set <FilmlistFormats > filmlistSaveFormats ;
33
37
private Map <FilmlistFormats , String > filmlistSavePaths ;
34
38
private Map <FilmlistFormats , String > filmlistDiffSavePaths ;
35
- private FilmlistFormats filmlistImportFormat ;
36
39
private String filmlistImportLocation ;
37
40
private MServerLogSettingsDTO logSettings ;
38
41
private Map <CrawlerUrlType , URL > crawlerURLs ;
39
42
private Map <CrawlerApiParam , String > crawlerApiParams ;
40
- private Boolean filmlistImporEnabled ;
41
43
42
44
public MServerConfigDTO () {
43
45
super ();
@@ -61,6 +63,9 @@ public MServerConfigDTO() {
61
63
62
64
maximumCpuThreads = 80 ;
63
65
maximumServerDurationInMinutes = 0 ;
66
+ checkImportListUrlMinSize = 2048L ;
67
+ checkImportListUrlTimeoutInSec = 3600L ;
68
+
64
69
filmlistSaveFormats .add (FilmlistFormats .JSON );
65
70
filmlistSaveFormats .add (FilmlistFormats .OLD_JSON );
66
71
filmlistSaveFormats .add (FilmlistFormats .JSON_COMPRESSED_XZ );
@@ -79,16 +84,13 @@ public MServerConfigDTO() {
79
84
filmlistSavePaths .put (FilmlistFormats .JSON_COMPRESSED_BZIP , "filmliste.json.bz" );
80
85
filmlistSavePaths .put (FilmlistFormats .OLD_JSON_COMPRESSED_BZIP , "filmliste_old.json.bz" );
81
86
82
- filmlistImporEnabled = true ;
83
- filmlistImportFormat = FilmlistFormats .OLD_JSON_COMPRESSED_XZ ;
84
- filmlistImportLocation = "https://verteiler1.mediathekview.de/Filmliste-akt.xz" ;
85
-
86
87
writeFilmlistHashFileEnabled = false ;
87
88
filmlistHashFilePath = "filmlist.hash" ;
88
89
writeFilmlistIdFileEnabled = true ;
89
90
filmlistIdFilePath = "filmlist.id" ;
90
91
ignoreFilmlistPath = "ignoreFilmlist.txt" ;
91
92
importLivestreamConfiguration = new ImportLivestreamConfiguration (false , "live-streams.json" , FilmlistFormats .OLD_JSON );
93
+ importFilmlistConfigurations = new ArrayList <>();
92
94
93
95
Arrays .stream (Sender .values ())
94
96
.forEach (sender -> senderConfigurations .put (sender , new MServerBasicConfigDTO (this )));
@@ -122,14 +124,6 @@ public void setFilmlistDiffSavePaths(final Map<FilmlistFormats, String> filmlist
122
124
this .filmlistDiffSavePaths = filmlistDiffSavePaths ;
123
125
}
124
126
125
- public FilmlistFormats getFilmlistImportFormat () {
126
- return filmlistImportFormat ;
127
- }
128
-
129
- public void setFilmlistImportFormat (final FilmlistFormats filmlistImportFormat ) {
130
- this .filmlistImportFormat = filmlistImportFormat ;
131
- }
132
-
133
127
public String getFilmlistImportLocation () {
134
128
return filmlistImportLocation ;
135
129
}
@@ -177,6 +171,22 @@ public Integer getMaximumServerDurationInMinutes() {
177
171
public void setMaximumServerDurationInMinutes (final Integer aMaximumServerDurationInMinutes ) {
178
172
maximumServerDurationInMinutes = aMaximumServerDurationInMinutes ;
179
173
}
174
+
175
+ public Long getCheckImportListUrlMinSize () {
176
+ return checkImportListUrlMinSize ;
177
+ }
178
+
179
+ public void setCheckImportListUrlMinSize (final Long checkImportListUrlMinSize ) {
180
+ this .checkImportListUrlMinSize = checkImportListUrlMinSize ;
181
+ }
182
+
183
+ public Long getCheckImportListUrlTimeoutInSec () {
184
+ return checkImportListUrlTimeoutInSec ;
185
+ }
186
+
187
+ public void setCheckImportListUrlTimeoutInSec (final Long checkImportListUrlTimeoutInSec ) {
188
+ this .checkImportListUrlTimeoutInSec = checkImportListUrlTimeoutInSec ;
189
+ }
180
190
181
191
public Map <Sender , MServerBasicConfigDTO > getSenderConfigurations () {
182
192
return senderConfigurations ;
@@ -242,6 +252,9 @@ public ImportLivestreamConfiguration getImportLivestreamConfiguration() {
242
252
return importLivestreamConfiguration ;
243
253
}
244
254
255
+ public List <ImportFilmlistConfiguration > getImportFilmlistConfigurations () {
256
+ return importFilmlistConfigurations ;
257
+ }
245
258
246
259
/**
247
260
* Loads the {@link Sender} specific configuration and if it not exist creates one.
@@ -255,14 +268,6 @@ public MServerBasicConfigDTO getSenderConfig(final Sender aSender) {
255
268
return senderConfigurations .get (aSender );
256
269
}
257
270
258
- public Boolean getFilmlistImporEnabled () {
259
- return filmlistImporEnabled ;
260
- }
261
-
262
- public void setFilmlistImporEnabled (final Boolean filmlistImporEnabled ) {
263
- this .filmlistImporEnabled = filmlistImporEnabled ;
264
- }
265
-
266
271
@ Override
267
272
public boolean equals (final Object o ) {
268
273
if (this == o ) {
@@ -276,25 +281,25 @@ public boolean equals(final Object o) {
276
281
}
277
282
return Objects .equals (getCopySettings (), that .getCopySettings ())
278
283
&& Objects .equals (getMaximumCpuThreads (), that .getMaximumCpuThreads ())
279
- && Objects .equals (
280
- getMaximumServerDurationInMinutes (), that .getMaximumServerDurationInMinutes ())
284
+ && Objects .equals (getMaximumServerDurationInMinutes (), that .getMaximumServerDurationInMinutes ())
285
+ && Objects .equals (getCheckImportListUrlMinSize (), that .getCheckImportListUrlMinSize ())
286
+ && Objects .equals (getCheckImportListUrlTimeoutInSec (), that .getCheckImportListUrlTimeoutInSec ())
281
287
&& Objects .equals (senderConfigurations , that .senderConfigurations )
282
288
&& Objects .equals (getSenderExcluded (), that .getSenderExcluded ())
283
289
&& Objects .equals (getSenderIncluded (), that .getSenderIncluded ())
284
290
&& Objects .equals (getFilmlistSaveFormats (), that .getFilmlistSaveFormats ())
285
291
&& Objects .equals (getFilmlistSavePaths (), that .getFilmlistSavePaths ())
286
292
&& Objects .equals (getFilmlistDiffSavePaths (), that .getFilmlistDiffSavePaths ())
287
- && getFilmlistImportFormat () == that .getFilmlistImportFormat ()
288
293
&& Objects .equals (getFilmlistImportLocation (), that .getFilmlistImportLocation ())
289
294
&& Objects .equals (getLogSettings (), that .getLogSettings ())
290
295
&& Objects .equals (getCrawlerURLs (), that .getCrawlerURLs ())
291
- && Objects .equals (getFilmlistImporEnabled (), that .getFilmlistImporEnabled ())
292
296
&& Objects .equals (getWriteFilmlistHashFileEnabled (), that .getWriteFilmlistHashFileEnabled ())
293
297
&& Objects .equals (getFilmlistHashFilePath (), that .getFilmlistHashFilePath ())
294
298
&& Objects .equals (getWriteFilmlistIdFileEnabled (), that .getWriteFilmlistIdFileEnabled ())
295
299
&& Objects .equals (getFilmlistIdFilePath (), that .getFilmlistIdFilePath ())
296
300
&& Objects .equals (getIgnoreFilmslistPath (), that .getIgnoreFilmslistPath ())
297
- && Objects .equals (getImportLivestreamConfiguration (), that .getImportLivestreamConfiguration ());
301
+ && Objects .equals (getImportLivestreamConfiguration (), that .getImportLivestreamConfiguration ())
302
+ && Objects .equals (getImportFilmlistConfigurations (), that .getImportFilmlistConfigurations ());
298
303
}
299
304
300
305
@ Override
@@ -304,23 +309,24 @@ public int hashCode() {
304
309
getCopySettings (),
305
310
getMaximumCpuThreads (),
306
311
getMaximumServerDurationInMinutes (),
312
+ getCheckImportListUrlMinSize (),
313
+ getCheckImportListUrlTimeoutInSec (),
307
314
senderConfigurations ,
308
315
getSenderExcluded (),
309
316
getSenderIncluded (),
310
317
getFilmlistSaveFormats (),
311
318
getFilmlistSavePaths (),
312
319
getFilmlistDiffSavePaths (),
313
- getFilmlistImportFormat (),
314
320
getFilmlistImportLocation (),
315
321
getLogSettings (),
316
322
getCrawlerURLs (),
317
- getFilmlistImporEnabled (),
318
323
getWriteFilmlistHashFileEnabled (),
319
324
getFilmlistHashFilePath (),
320
325
getWriteFilmlistIdFileEnabled (),
321
326
getFilmlistIdFilePath (),
322
327
getIgnoreFilmslistPath (),
323
- getImportLivestreamConfiguration ());
328
+ getImportLivestreamConfiguration (),
329
+ getImportFilmlistConfigurations ());
324
330
}
325
331
326
332
public void initializeSenderConfigurations () {
0 commit comments