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:
+16
-12
@@ -52,15 +52,13 @@ const SYSTEM_DIRS: &[&str] = &[
|
|||||||
"windowsapps",
|
"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] = &[
|
const SKIP_DIRS: &[&str] = &[
|
||||||
"battle.net",
|
"battle.net", // Battle.net launcher dir; its games live elsewhere
|
||||||
"electronic arts",
|
"ea desktop", // EA Desktop launcher subfolder only
|
||||||
"ea desktop",
|
"gog galaxy", // GOG Galaxy launcher; games are normally in GOG Games/
|
||||||
"epic games",
|
|
||||||
"gog galaxy",
|
|
||||||
"ubisoft",
|
|
||||||
"rockstar games",
|
|
||||||
"wine",
|
"wine",
|
||||||
"mono",
|
"mono",
|
||||||
"gecko",
|
"gecko",
|
||||||
@@ -402,19 +400,25 @@ fn read_epic_manifest(dir: &Path) -> Option<String> {
|
|||||||
///
|
///
|
||||||
/// Launchers install each game into a named subdirectory of their own folder.
|
/// Launchers install each game into a named subdirectory of their own folder.
|
||||||
/// That subdirectory name *is* the display name:
|
/// That subdirectory name *is* the display name:
|
||||||
/// - Epic: `…/Epic Games/<GameName>/…`
|
/// - Epic: `…/Epic Games/<GameName>/…`
|
||||||
/// - GOG: `…/GOG Games/<GameName>/…`
|
/// - GOG: `…/GOG Games/<GameName>/…`
|
||||||
/// - Steam: `…/steamapps/common/<GameName>/…`
|
/// - Steam: `…/steamapps/common/<GameName>/…`
|
||||||
/// - Rockstar:`…/Rockstar Games/<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> {
|
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();
|
let comps: Vec<&std::ffi::OsStr> = exe_path.components().map(|c| c.as_os_str()).collect();
|
||||||
|
|
||||||
for (i, comp) in comps.iter().enumerate() {
|
for (i, comp) in comps.iter().enumerate() {
|
||||||
let lower = comp.to_str().unwrap_or("").to_lowercase();
|
let lower = comp.to_str().unwrap_or("").to_lowercase();
|
||||||
match lower.as_str() {
|
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);
|
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"
|
"common"
|
||||||
if i > 0
|
if i > 0
|
||||||
&& comps[i - 1].to_str().unwrap_or("").to_lowercase() == "steamapps" =>
|
&& comps[i - 1].to_str().unwrap_or("").to_lowercase() == "steamapps" =>
|
||||||
|
|||||||
Reference in New Issue
Block a user