Skip to content

Commit 868f590

Browse files
MinoDab492sparrbudak7273
authored
Fix Steam BetaKey capitalization (#303)
* Fix BetaKey capitalization, so that mod compatibility is filtered properly with Experimental on Steam * Case insensitivity * Update backend/installfinders/launchers/steam/steam.go Co-authored-by: Clarence "Sparr" Risher <[email protected]> * Update backend/installfinders/launchers/steam/steam.go Co-authored-by: Clarence "Sparr" Risher <[email protected]> * Update backend/installfinders/launchers/steam/steam.go Co-authored-by: Clarence "Sparr" Risher <[email protected]> --------- Co-authored-by: Clarence "Sparr" Risher <[email protected]> Co-authored-by: Rob B <[email protected]>
1 parent b4d3c83 commit 868f590

File tree

1 file changed

+12
-2
lines changed
  • backend/installfinders/launchers/steam

1 file changed

+12
-2
lines changed

backend/installfinders/launchers/steam/steam.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77
"path/filepath"
88
"strconv"
9+
"strings"
910

1011
"github.com/andygrunwald/vdf"
1112

@@ -107,8 +108,17 @@ func FindInstallationsSteam(steamPath string, launcher string, platform common.L
107108

108109
var branch common.GameBranch
109110
userConfig := manifest["AppState"].(map[string]interface{})["UserConfig"].(map[string]interface{})
110-
betakey, ok := userConfig["betakey"]
111-
if !ok {
111+
112+
// Steam has changed the case of this field name multiple times. Find it case-insensitively.
113+
var betakey string
114+
for k, v := range userConfig {
115+
if strings.EqualFold(k, "BetaKey") {
116+
betakey = v.(string)
117+
break
118+
}
119+
}
120+
121+
if betakey == "" || betakey == "public" {
112122
branch = common.BranchStable
113123
} else {
114124
if betakey == "experimental" {

0 commit comments

Comments
 (0)