From 208599711adc4ff247e0d806db02c7ef102dd969 Mon Sep 17 00:00:00 2001 From: Nihaal Sangha Date: Mon, 24 Jun 2024 23:29:07 +0100 Subject: [PATCH 1/2] Prioritise Lutris spec game path over DB game path Editing the .exe path in Lutris only changes the .yml and not the database, so if in the future we actually set the `install_dir` in `scan_db`, we should make sure we still prioritise the .yml value. --- src/scan/launchers/lutris.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scan/launchers/lutris.rs b/src/scan/launchers/lutris.rs index 5078339..7f367b4 100644 --- a/src/scan/launchers/lutris.rs +++ b/src/scan/launchers/lutris.rs @@ -75,7 +75,7 @@ impl Pending { // so we prefer the spec version. prefix: spec.prefix.or(db.prefix), platform: spec.platform.or(db.platform), - install_dir: db.install_dir.or(spec.install_dir), + install_dir: spec.install_dir.or(db.install_dir), } } } From 8e10fea4e4f5306b95b8cecdeb051118486ccf2d Mon Sep 17 00:00:00 2001 From: Nihaal Sangha Date: Mon, 24 Jun 2024 23:38:36 +0100 Subject: [PATCH 2/2] Use Lutris DB platform value over spec It is unlikely that this would ever change for a game so it's less important to ensure that we're prioritising the correct source, but while we could likely try to infer the platform from what fields are used in the spec and what form they're in, the database contains an explicit value which is more likely to be used when deciding how to launch a game than an inference process. We also never set `platform` in `scan_spec` so this is also a minor optimisation. --- src/scan/launchers/lutris.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scan/launchers/lutris.rs b/src/scan/launchers/lutris.rs index 7f367b4..75be843 100644 --- a/src/scan/launchers/lutris.rs +++ b/src/scan/launchers/lutris.rs @@ -74,7 +74,7 @@ impl Pending { // Lutris updates the spec, but not the database, // so we prefer the spec version. prefix: spec.prefix.or(db.prefix), - platform: spec.platform.or(db.platform), + platform: db.platform.or(spec.platform), install_dir: spec.install_dir.or(db.install_dir), } }