Skip to content

Commit

Permalink
Merge pull request #2075 from candela97/improve-cdn2
Browse files Browse the repository at this point in the history
Add support for fastly CDN, make CDN optional
  • Loading branch information
tfedor authored Nov 19, 2024
2 parents 681b005 + 5dca940 commit 8e46c4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/js/Content/Modules/Widgets/AugmentedSteamMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
const confirm = await SteamFacade.showConfirmDialog(
L(__playGame, {gamename}),
`<img src="//cdn.cloudflare.steamstatic.com/steam/apps/${gameid}/header.jpg">`,
`<img src="//shared.cloudflare.steamstatic.com/store_item_assets/steam/apps/${gameid}/header.jpg">`,
{
secondaryActionButton: L(__visitStore)
}
Expand Down
4 changes: 2 additions & 2 deletions src/js/Core/GameId/AppId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export default class AppId {
}

static fromCDNUrl(url: string): number|null {
const CDNRegex_1 = /(?:cdn\.(?:akamai|cloudflare)\.steamstatic\.com\/steam|steamcdn-a\.akamaihd\.net\/steam|steamcommunity\/public\/images)\/apps\/(\d+)\//;
const CDNRegex_2 = /shared\.(?:akamai|cloudflare)\.steamstatic\.com\/store_item_assets\/steam\/apps\/(\d+)\//;
const CDNRegex_1 = /(?:cdn\.(?:(?:akamai|cloudflare|fastly)\.)?steamstatic\.com\/steam|steamcdn-a\.akamaihd\.net\/steam|steamcommunity\/public\/images)\/apps\/(\d+)\//;
const CDNRegex_2 = /shared\.(?:(?:akamai|cloudflare|fastly)\.)?steamstatic\.com\/store_item_assets\/steam\/apps\/(\d+)\//;
const m = url.match(CDNRegex_1) ?? url.match(CDNRegex_2);
return m && m[1] !== undefined
? Number(m[1])
Expand Down
2 changes: 1 addition & 1 deletion src/scriptlets/Store/Wishlist/hiddenApps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
const html = (window.asHiddenApps ??= hiddenApps).map(appid => {
return `<div class="as-wl-remove-row" data-appid="${appid}">
<a href="//steamcommunity.com/app/${appid}/discussions/" target="_blank">
<img src="//cdn.cloudflare.steamstatic.com/steam/apps/${appid}/header_292x136.jpg" loading="lazy">
<img src="//shared.cloudflare.steamstatic.com/store_item_assets/steam/apps/${appid}/header_292x136.jpg" loading="lazy">
</a>
<a href="https://isthereanydeal.com/steam/app/${appid}/" target="_blank"><img src="${icons.itad}" title="ITAD"></a>
<a href="https://steamdb.info/app/${appid}/" target="_blank"><img src="${icons.steamdb}" title="SteamDB"></a>
Expand Down

0 comments on commit 8e46c4f

Please sign in to comment.