From 596e9a188be867b28efaf7d5fb479570753085cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Mi=C5=A1o=20=C4=8Cerve=C5=88=C3=A1k?= Date: Sat, 25 May 2024 22:47:40 +0200 Subject: [PATCH] fix series results --- src/Requests/SeriesResultsRequest.php | 9 +++------ tools/downloader.php | 12 +++++------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Requests/SeriesResultsRequest.php b/src/Requests/SeriesResultsRequest.php index a5df201..369c48e 100644 --- a/src/Requests/SeriesResultsRequest.php +++ b/src/Requests/SeriesResultsRequest.php @@ -8,18 +8,16 @@ class SeriesResultsRequest implements Request { private int $contestId; private int $year; - private int $series; - public function __construct(int $contestId, int $year, int $series) + public function __construct(int $contestId, int $year) { $this->contestId = $contestId; $this->year = $year; - $this->series = $series; } public function getMethod(): string { - return 'GetSeriesResults'; + return sprintf('contests/%d/years/%d/results', $this->contestId, $this->year); } public function getParams(): array @@ -27,12 +25,11 @@ public function getParams(): array return [ 'contestId' => $this->contestId, 'year' => $this->year, - 'series' => $this->series, ]; } public function getCacheKey(): string { - return sprintf('series.results.%s.%s.%s', $this->contestId, $this->year, $this->series); + return sprintf('series.results.%s.%s', $this->contestId, $this->year); } } diff --git a/tools/downloader.php b/tools/downloader.php index c66e1fe..3498fab 100644 --- a/tools/downloader.php +++ b/tools/downloader.php @@ -9,12 +9,10 @@ require_once __DIR__ . '/pass.php'; $downloader = new FKSDBDownloader(FKSDB_WSDL, FKSDB_USER, FKSDB_PASS, FKSDB_API); -$newDownloader = new Downloader([ - 'fksdb' => [ - 'url' => FKSDB_API, - 'username' => FKSDB_USER, - 'password' => FKSDB_PASS, - ], -]); +$newDownloader = new Downloader( + FKSDB_API, + FKSDB_USER, + FKSDB_PASS, +); return $newDownloader;