Skip to content

Commit

Permalink
fix: Renamed getMetadataPhotosSizeForFileId to getImageMetadataForFileId
Browse files Browse the repository at this point in the history
Signed-off-by: skalidindi53 <s.teja2004@gmail.com>
  • Loading branch information
skalidindi53 committed Aug 20, 2024
1 parent dfc2b70 commit 51d419b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ protected function getFileFromShare(Room $room, ?Participant $participant, strin
// If a preview is available, check if we can get the dimensions of the file from the metadata API
if ($isPreviewAvailable && str_starts_with($node->getMimeType(), 'image/')) {
try {
$sizeMetadata = $this->metadataCache->getMetadataPhotosSizeForFileId($fileId);
$sizeMetadata = $this->metadataCache->getImageMetadataForFileId($fileId);
if (isset($sizeMetadata['width'], $sizeMetadata['height'])) {
$data['width'] = (string) $sizeMetadata['width'];
$data['height'] = (string) $sizeMetadata['height'];
Expand Down
2 changes: 1 addition & 1 deletion lib/Share/Helper/FilesMetadataCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function preloadMetadata(array $fileIds): void {
* @psalm-return array{width: int, height: int, blurhash?: string}
* @throws FilesMetadataNotFoundException
*/
public function getMetadataPhotosSizeForFileId(int $fileId): array {
public function getImageMetadataForFileId(int $fileId): array {
if (!array_key_exists($fileId, $this->filesSizeData)) {
try {
$this->cachePhotosSize($fileId, $this->filesMetadataManager->getMetadata($fileId, true));
Expand Down
8 changes: 4 additions & 4 deletions tests/php/Chat/Parser/SystemMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ public function testGetFileFromShareForGuest(): void {
->willReturn(true);

$this->filesMetadataCache->expects($this->once())
->method('getMetadataPhotosSizeForFileId')
->method('getImageMetadataForFileId')
->with(54)
->willReturn(['width' => 1234, 'height' => 4567]);

Expand Down Expand Up @@ -706,7 +706,7 @@ public function testGetFileFromShareForGuestWithBlurhash(): void {
->willReturn(true);

$this->filesMetadataCache->expects($this->once())
->method('getMetadataPhotosSizeForFileId')
->method('getImageMetadataForFileId')
->with(54)
->willReturn([
'width' => 1234,
Expand Down Expand Up @@ -786,7 +786,7 @@ public function testGetFileFromShareForOwner(): void {
->willReturn('absolute-link-owner');

$this->filesMetadataCache->expects($this->never())
->method('getMetadataPhotosSizeForFileId');
->method('getImageMetadataForFileId');

$participant = $this->createMock(Participant::class);
$attendee = Attendee::fromRow([
Expand Down Expand Up @@ -873,7 +873,7 @@ public function testGetFileFromShareForRecipient(): void {
->willReturn(false);

$this->filesMetadataCache->expects($this->never())
->method('getMetadataPhotosSizeForFileId');
->method('getImageMetadataForFileId');

$this->url->expects($this->once())
->method('linkToRouteAbsolute')
Expand Down

0 comments on commit 51d419b

Please sign in to comment.