Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions webapp/src/DataTransferObject/Shadowing/SubmissionFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ class SubmissionFile
public function __construct(
public readonly string $href,
public readonly ?string $mime,
public readonly ?string $filename,
) {}
}
18 changes: 13 additions & 5 deletions webapp/src/Service/ExternalContestSourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function getApiVersion(): ?string
throw new LogicException('The contest source is not valid');
}

return $this->cachedApiInfoData->version;
return $this->cachedApiInfoData?->version;
}

public function getApiVersionUrl(): ?string
Expand All @@ -209,7 +209,7 @@ public function getApiVersionUrl(): ?string
throw new LogicException('The contest source is not valid');
}

return $this->cachedApiInfoData->versionUrl;
return $this->cachedApiInfoData?->versionUrl;
}

public function getApiProviderName(): ?string
Expand All @@ -218,7 +218,7 @@ public function getApiProviderName(): ?string
throw new LogicException('The contest source is not valid');
}

return $this->cachedApiInfoData->provider?->name ?? $this->cachedApiInfoData->name;
return $this->cachedApiInfoData?->provider?->name ?? $this->cachedApiInfoData?->name;
}

public function getApiProviderVersion(): ?string
Expand All @@ -227,7 +227,7 @@ public function getApiProviderVersion(): ?string
throw new LogicException('The contest source is not valid');
}

return $this->cachedApiInfoData->provider?->version ?? $this->cachedApiInfoData->domjudge?->version;
return $this->cachedApiInfoData?->provider?->version ?? $this->cachedApiInfoData?->domjudge?->version;
}

public function getApiProviderBuildDate(): ?string
Expand All @@ -236,7 +236,7 @@ public function getApiProviderBuildDate(): ?string
throw new LogicException('The contest source is not valid');
}

return $this->cachedApiInfoData->provider?->buildDate;
return $this->cachedApiInfoData?->provider?->buildDate;
}

public function getLoadingError(): string
Expand Down Expand Up @@ -1435,6 +1435,14 @@ protected function importSubmission(Event $event, EventData $data): void
$zipUrl = ($this->basePath ?? '') . $zipUrl;
}

if ($this->source->getType() === ExternalContestSource::TYPE_CONTEST_PACKAGE && $data->files[0]->filename) {
$zipUrl = $this->source->getSource() . '/submissions/' . $data->id . '/' . $data->files[0]->filename;
if (!file_exists($zipUrl)) {
// Common case: submissions are in submissions/<id>.zip
$zipUrl = $this->source->getSource() . '/submissions/' . $data->id . '.zip';
}
}

$tmpdir = $this->dj->getDomjudgeTmpDir();

// Check if we have a local file.
Expand Down
Loading