Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fastly CDN, make CDN optional #2075

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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