detect: fix SKIP_DIRS blocking game discovery for Epic, Ubisoft, Rockstar
SKIP_DIRS contained parent directories that also contain game installs, which prevented those games from ever being scanned: - "epic games" → all Epic games live inside this dir - "ubisoft" → Ubisoft games at Ubisoft/Ubisoft Game Launcher/games/ - "rockstar games" → Rockstar games live directly inside this dir - "electronic arts" → some EA games live here SKIP_EXES already filters the individual launcher executables, so the directory-level blocks are redundant and harmful. Trim SKIP_DIRS to only directories that genuinely contain no game executables (battle.net, ea desktop, gog galaxy, Wine infrastructure). Add missing launcher path patterns to name_from_launcher_path: - "ea games" → EA Games/<GameName>/ - "ubisoft game launcher" → Ubisoft Game Launcher/games/<GameName>/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-9
@@ -52,15 +52,13 @@ const SYSTEM_DIRS: &[&str] = &[
|
||||
"windowsapps",
|
||||
];
|
||||
|
||||
/// Directory names that contain launcher infrastructure, not games.
|
||||
/// Directory names that are pure launcher infrastructure — no game executables
|
||||
/// are ever installed here. Do NOT add parent dirs like "Epic Games" or
|
||||
/// "Ubisoft" that also contain game subdirectories; use SKIP_EXES instead.
|
||||
const SKIP_DIRS: &[&str] = &[
|
||||
"battle.net",
|
||||
"electronic arts",
|
||||
"ea desktop",
|
||||
"epic games",
|
||||
"gog galaxy",
|
||||
"ubisoft",
|
||||
"rockstar games",
|
||||
"battle.net", // Battle.net launcher dir; its games live elsewhere
|
||||
"ea desktop", // EA Desktop launcher subfolder only
|
||||
"gog galaxy", // GOG Galaxy launcher; games are normally in GOG Games/
|
||||
"wine",
|
||||
"mono",
|
||||
"gecko",
|
||||
@@ -406,15 +404,21 @@ fn read_epic_manifest(dir: &Path) -> Option<String> {
|
||||
/// - GOG: `…/GOG Games/<GameName>/…`
|
||||
/// - Steam: `…/steamapps/common/<GameName>/…`
|
||||
/// - Rockstar:`…/Rockstar Games/<GameName>/…`
|
||||
/// - EA: `…/EA Games/<GameName>/…`
|
||||
/// - Ubisoft: `…/Ubisoft Game Launcher/games/<GameName>/…`
|
||||
fn name_from_launcher_path(exe_path: &Path) -> Option<String> {
|
||||
let comps: Vec<&std::ffi::OsStr> = exe_path.components().map(|c| c.as_os_str()).collect();
|
||||
|
||||
for (i, comp) in comps.iter().enumerate() {
|
||||
let lower = comp.to_str().unwrap_or("").to_lowercase();
|
||||
match lower.as_str() {
|
||||
"epic games" | "gog games" | "rockstar games" => {
|
||||
"epic games" | "gog games" | "rockstar games" | "ea games" => {
|
||||
return comps.get(i + 1).and_then(|c| c.to_str()).map(str::to_string);
|
||||
}
|
||||
// Ubisoft: …/Ubisoft Game Launcher/games/<GameName>/…
|
||||
"ubisoft game launcher" => {
|
||||
return comps.get(i + 2).and_then(|c| c.to_str()).map(str::to_string);
|
||||
}
|
||||
"common"
|
||||
if i > 0
|
||||
&& comps[i - 1].to_str().unwrap_or("").to_lowercase() == "steamapps" =>
|
||||
|
||||
Reference in New Issue
Block a user