Skip to content

Commit acccf74

Browse files
committed
fix(scanner): resolve library symlinks, filter dummy offline profiles, and preserve Linux case sensitivity
1 parent 12996e0 commit acccf74

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

‎src/restorer.go‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,14 @@ func findSteamLibraryFolders() []string {
535535
if clean == "" || clean == "." {
536536
return
537537
}
538-
if !seen[clean] {
539-
if stat, err := os.Stat(clean); err == nil && stat.IsDir() {
540-
seen[clean] = true
541-
libraries = append(libraries, clean)
538+
canonical := clean
539+
if target, err := filepath.EvalSymlinks(clean); err == nil && target != "" {
540+
canonical = filepath.Clean(target)
541+
}
542+
if !seen[canonical] {
543+
if stat, err := os.Stat(canonical); err == nil && stat.IsDir() {
544+
seen[canonical] = true
545+
libraries = append(libraries, canonical)
542546
}
543547
}
544548
}

‎src/scanner.go‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,10 @@ func getCanonicalPath(path string) string {
15451545
if resolved, err := filepath.EvalSymlinks(clean); err == nil {
15461546
clean = resolved
15471547
}
1548-
return strings.ToLower(clean)
1548+
if runtime.GOOS == "windows" {
1549+
return strings.ToLower(clean)
1550+
}
1551+
return clean
15491552
}
15501553

15511554
func getSteamInstallRoots() []string {
@@ -3757,7 +3760,8 @@ func scanAppIDSubdirs(basePath, storageType, targetRelBase string, games *[]Dete
37573760
}
37583761

37593762
fileCount, size := getDirStats(fullPath)
3760-
if fileCount == 0 {
3763+
if fileCount == 0 || size <= 16 {
3764+
// Skip empty folders or dummy placeholder files (e.g. 2-byte \r\n files) generated by offline wrappers
37613765
continue
37623766
}
37633767

@@ -4034,6 +4038,8 @@ func scanInTreeDirectory(rootDir string, games *[]DetectedGame, seen map[string]
40344038
appName = getGameName(mappedID, appName)
40354039
} else if mappedID := findAppIDByMachineCorrelation(gameParent, *games); mappedID != "" {
40364040
appName = getGameName(mappedID, appName)
4041+
} else if strings.EqualFold(appName, "roguecore") || strings.Contains(strings.ToLower(gameFolder), "roguecore") || strings.Contains(strings.ToLower(gameFolder), "rogue core") {
4042+
appName = "Deep Rock Galactic: Rogue Core"
40374043
} else if strings.EqualFold(appName, "fsd") || strings.Contains(strings.ToLower(gameFolder), "deep rock") {
40384044
appName = "Deep Rock Galactic"
40394045
}
@@ -4721,6 +4727,12 @@ func scanDuckStationDir(duckDir string, games *[]DetectedGame, seen map[string]b
47214727
}
47224728

47234729
func scanWinePrefix(prefixRoot string, originAppID string, games *[]DetectedGame, seen map[string]bool) {
4730+
prefixRoot = getCanonicalPath(prefixRoot)
4731+
if seen["prefix_"+prefixRoot] {
4732+
return
4733+
}
4734+
seen["prefix_"+prefixRoot] = true
4735+
47244736
driveC := filepath.Join(prefixRoot, "drive_c")
47254737
if stat, err := os.Stat(driveC); err != nil || !stat.IsDir() {
47264738
driveC = filepath.Join(prefixRoot, "pfx", "drive_c")

0 commit comments

Comments
 (0)