@@ -200,7 +200,7 @@ public function getApiVersion(): ?string
200
200
throw new LogicException ('The contest source is not valid ' );
201
201
}
202
202
203
- return $ this ->cachedApiInfoData ->version ;
203
+ return $ this ->cachedApiInfoData ? ->version;
204
204
}
205
205
206
206
public function getApiVersionUrl (): ?string
@@ -209,7 +209,7 @@ public function getApiVersionUrl(): ?string
209
209
throw new LogicException ('The contest source is not valid ' );
210
210
}
211
211
212
- return $ this ->cachedApiInfoData ->versionUrl ;
212
+ return $ this ->cachedApiInfoData ? ->versionUrl;
213
213
}
214
214
215
215
public function getApiProviderName (): ?string
@@ -218,7 +218,7 @@ public function getApiProviderName(): ?string
218
218
throw new LogicException ('The contest source is not valid ' );
219
219
}
220
220
221
- return $ this ->cachedApiInfoData ->provider ?->name ?? $ this ->cachedApiInfoData ->name ;
221
+ return $ this ->cachedApiInfoData ? ->provider?->name ?? $ this ->cachedApiInfoData ? ->name;
222
222
}
223
223
224
224
public function getApiProviderVersion (): ?string
@@ -227,7 +227,7 @@ public function getApiProviderVersion(): ?string
227
227
throw new LogicException ('The contest source is not valid ' );
228
228
}
229
229
230
- return $ this ->cachedApiInfoData ->provider ?->version ?? $ this ->cachedApiInfoData ->domjudge ?->version;
230
+ return $ this ->cachedApiInfoData ? ->provider?->version ?? $ this ->cachedApiInfoData ? ->domjudge?->version;
231
231
}
232
232
233
233
public function getApiProviderBuildDate (): ?string
@@ -236,7 +236,7 @@ public function getApiProviderBuildDate(): ?string
236
236
throw new LogicException ('The contest source is not valid ' );
237
237
}
238
238
239
- return $ this ->cachedApiInfoData ->provider ?->buildDate;
239
+ return $ this ->cachedApiInfoData ? ->provider?->buildDate;
240
240
}
241
241
242
242
public function getLoadingError (): string
@@ -1017,7 +1017,7 @@ protected function validateAndUpdateProblem(Event $event, EventData $data): void
1017
1017
);
1018
1018
$ contestProblem ->setShortname ($ data ->label );
1019
1019
}
1020
- if ($ contestProblem ->getColor () !== ( $ data ->rgb ) ) {
1020
+ if ($ data -> rgb && $ contestProblem ->getColor () !== $ data ->rgb ) {
1021
1021
$ this ->logger ->warning (
1022
1022
'Contest problem color does not match between feed (%s) and local (%s), updating ' ,
1023
1023
[$ data ->rgb , $ contestProblem ->getColor ()]
@@ -1435,6 +1435,14 @@ protected function importSubmission(Event $event, EventData $data): void
1435
1435
$ zipUrl = ($ this ->basePath ?? '' ) . $ zipUrl ;
1436
1436
}
1437
1437
1438
+ if ($ this ->source ->getType () === ExternalContestSource::TYPE_CONTEST_PACKAGE && $ data ->files [0 ]->filename ) {
1439
+ $ zipUrl = $ this ->source ->getSource () . '/submissions/ ' . $ data ->id . '/ ' . $ data ->files [0 ]->filename ;
1440
+ if (!file_exists ($ zipUrl )) {
1441
+ // Common case: submissions are in submissions/<id>.zip
1442
+ $ zipUrl = $ this ->source ->getSource () . '/submissions/ ' . $ data ->id . '.zip ' ;
1443
+ }
1444
+ }
1445
+
1438
1446
$ tmpdir = $ this ->dj ->getDomjudgeTmpDir ();
1439
1447
1440
1448
// Check if we have a local file.
0 commit comments