Skip to content

Commit d37a6be

Browse files
committed
Only extract ssr chunks if any of the preloaded files changed
1 parent c3de0db commit d37a6be

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

update.php

+11-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class SteamTracker
3131
private bool $SyncProtobufs = false;
3232
private bool $DumpJavascriptFiles = false;
3333
private bool $UpdateManifestUrls = false;
34+
private bool $UpdateSSRUrls = false;
3435

3536
/** @var array<string, string> */
3637
private array $ClientArchiveFolder =
@@ -133,7 +134,7 @@ public function __construct( string $Option )
133134
while( !empty( $this->URLsToFetch ) && $Tries-- > 0 );
134135
}
135136

136-
if( !empty( $this->CurrentSSRFiles ) )
137+
if( $this->UpdateSSRUrls && !empty( $this->CurrentSSRFiles ) )
137138
{
138139
do
139140
{
@@ -528,12 +529,15 @@ private function HandleResponse( string $File, string $Data, string $URL ) : boo
528529
mkdir( $Folder, 0755, true );
529530
}
530531

532+
$IsSSR =
533+
str_starts_with( $OriginalFile, 'store.steampowered.com/ssr' );
534+
531535
if(
536+
$IsSSR ||
532537
str_ends_with( $File, 'english-json.js' ) ||
533538
str_starts_with( $OriginalFile, 'www.underlords.com/' ) ||
534539
str_starts_with( $OriginalFile, 'www.dota2.com/' ) ||
535540
str_starts_with( $OriginalFile, 'www.counter-strike.net/' ) ||
536-
str_starts_with( $OriginalFile, 'store.steampowered.com/ssr' ) ||
537541
str_starts_with( $OriginalFile, 'Scripts/WebUI/steammobile' ) ||
538542
str_contains( $OriginalFile, '/webui/' ) ||
539543
str_contains( $OriginalFile, '/legacy_web/' ) ||
@@ -564,6 +568,11 @@ private function HandleResponse( string $File, string $Data, string $URL ) : boo
564568

565569
file_put_contents( $File, $Data );
566570

571+
if( $IsSSR )
572+
{
573+
$this->UpdateSSRUrls = true;
574+
}
575+
567576
if( str_ends_with( $File, '.js' ) )
568577
{
569578
if( str_ends_with( $File, '/manifest.js' ) )

0 commit comments

Comments
 (0)