mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 09:54:17 +02:00
hide hash for private demos
This commit is contained in:
parent
4f07dbbf34
commit
9595b7f6f5
2 changed files with 6 additions and 1 deletions
|
|
@ -259,7 +259,7 @@ class Demo implements JsonSerializable {
|
||||||
'blueScore' => $this->getBlueScore(),
|
'blueScore' => $this->getBlueScore(),
|
||||||
'playerCount' => $this->getPlayerCount(),
|
'playerCount' => $this->getPlayerCount(),
|
||||||
'uploader' => $this->uploaderUser ? $this->getUploaderUser()->jsonSerialize() : $this->getUploader(),
|
'uploader' => $this->uploaderUser ? $this->getUploaderUser()->jsonSerialize() : $this->getUploader(),
|
||||||
'hash' => $this->getHash(),
|
'hash' => $isPublic ? $this->getHash() : '',
|
||||||
'backend' => $isPublic ? $this->getBackend() : '',
|
'backend' => $isPublic ? $this->getBackend() : '',
|
||||||
'path' => $isPublic ? $this->getPath() : '',
|
'path' => $isPublic ? $this->getPath() : '',
|
||||||
'private_until' => $this->getPrivateUntil()?->format(\DateTimeImmutable::ATOM),
|
'private_until' => $this->getPrivateUntil()?->format(\DateTimeImmutable::ATOM),
|
||||||
|
|
|
||||||
|
|
@ -248,6 +248,11 @@ class DemoProviderTest extends TestCase {
|
||||||
} else {
|
} else {
|
||||||
$this->assertEquals('', $json['url']);
|
$this->assertEquals('', $json['url']);
|
||||||
}
|
}
|
||||||
|
if ($visible) {
|
||||||
|
$this->assertEquals('hash', $json['hash']);
|
||||||
|
} else {
|
||||||
|
$this->assertEquals('', $json['hash']);
|
||||||
|
}
|
||||||
|
|
||||||
$storedDemo->showPrivateData(true);
|
$storedDemo->showPrivateData(true);
|
||||||
$json = $storedDemo->jsonSerialize();
|
$json = $storedDemo->jsonSerialize();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue