Skip to content

Commit

Permalink
grrr
Browse files Browse the repository at this point in the history
  • Loading branch information
vys69 committed Nov 5, 2024
1 parent a7327dd commit c363151
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dist/routes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/routes.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,14 @@ router.get('/games/:gameId/:gameName?', async (req, res) => {

// Check if the provided gameName matches the fetched data
const encodedGameName = encodeURIComponent(gameData.name.replace(/\s+/g, '-'));
if (gameName !== encodedGameName) {
if (gameName && gameName !== encodedGameName) {
return res.redirect(`/games/${gameId}/${encodedGameName}`);
}

// Construct game thumbnail URL
const thumbnailUrl = `https://www.roblox.com/asset-thumbnail/image?assetId=${gameId}&width=768&height=432&format=png`;

const metaTags = `
<meta property="og:site_name" content="FixRoblox / Rxblox">
<meta property="og:title" content="${gameData.name}">
<meta property="og:description" content="${gameData.description || 'No description available'}">
<meta property="og:image" content="${thumbnailUrl}">
Expand All @@ -379,7 +379,7 @@ router.get('/games/:gameId/:gameName?', async (req, res) => {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${gameData.name} - Roblox Game</title>
<title>${gameData.name} - Roblox</title>
${metaTags}
</head>
<body>
Expand Down

0 comments on commit c363151

Please sign in to comment.