Skip to content

Commit

Permalink
Adding full support for assets' extension (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
liarco committed Jan 14, 2022
1 parent a94a3cf commit 386c632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/Config/RouteName.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,4 @@ class RouteName
* @var string
*/
final public const GET_METADATA = 'get_metadata';

/**
* @var string
*/
final public const GET_TOTAL_SUPPLY = 'get_total_supply';
}
15 changes: 4 additions & 11 deletions src/Service/CollectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@ public function shuffle(int $min, int $max): void
$this->cache->delete(self::CACHE_MAPPING);
}

public function getAssetsExtension(): string
{
return $this->collectionFilesystemDriver->getAssetsExtension();
}

public function getHiddenAssetExtension(): string
{
return $this->collectionFilesystemDriver->getHiddenAssetExtension();
}

/**
* @return array<string, mixed>
*/
Expand All @@ -96,6 +86,7 @@ public function getMetadata(int $tokenId, string $assetUri = null): array
RouteName::GET_ASSET,
[
'tokenId' => $tokenId,
'_format' => $this->collectionFilesystemDriver->getAssetsExtension(),
],
UrlGeneratorInterface::ABSOLUTE_URL,
),
Expand All @@ -119,7 +110,9 @@ public function getHiddenMetadata(string $assetUri = null): array

$hiddenMetadata['image'] = $assetUri ?? $this->urlGenerator->generate(
RouteName::GET_HIDDEN_ASSET,
[],
[
'_format' => $this->collectionFilesystemDriver->getHiddenAssetExtension(),
],
UrlGeneratorInterface::ABSOLUTE_URL,
);

Expand Down

0 comments on commit 386c632

Please sign in to comment.