Skip to content

Commit

Permalink
Issue 69: Drop the media id variable, just call $media->id().
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Dec 11, 2024
1 parent 1a9be86 commit f1b4d15
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Controller/ViewerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,10 @@ protected function getViewerRender(MediaInterface $media, string $wopi_client, b
$wopi_base = $cool_settings['wopi_base'];
$allowfullscreen = $cool_settings['allowfullscreen'] ?? FALSE;

$id = $media->id();

$expire_timestamp = $this->getExpireTimestamp();
$access_token = $this->jwtTranscoder->encode(
[
'fid' => $id,
'fid' => $media->id(),
'uid' => $this->currentUser->id(),
'wri' => $can_write,
],
Expand All @@ -158,7 +156,7 @@ protected function getViewerRender(MediaInterface $media, string $wopi_client, b

$render_array = [
'#wopiClient' => $wopi_client,
'#wopiSrc' => urlencode($wopi_base . '/cool/wopi/files/' . $id),
'#wopiSrc' => urlencode($wopi_base . '/cool/wopi/files/' . $media->id()),
'#accessToken' => $access_token,
// Convert to milliseconds.
'#accessTokenTtl' => $expire_timestamp * 1000,
Expand Down

0 comments on commit f1b4d15

Please sign in to comment.